python读取.txt文件跳过第一行

    科技2026-01-26  11

    next()函数

    示例代码:

    def getLabel(file): res = [] with open(file, 'r') as f: next(f) for line in f: l = line.split() res.append(int(l[2])) return res
    Processed: 0.026, SQL: 9