import csv data = open('data.csv', 'r') lines = csv.reader(data) i = 0 for line in lines: i = i + 1 print(i)
脚本读取的数据行数为:
但实际文件中的行数为: