我有一个需要循环的 .csv 文件,然后在循环内,我想在每次迭代时检查下一行的值。我似乎无法让它正常工作,因为它跳过了我在下一次迭代中展望的那一行。
import csv
file_object = open('file.csv', 'r')
reader = csv.reader(file_object, delimiter = ';')
for line in reader:
next_line = reader.next()
# It now reads the next line and doesn't iterate over it again in the next
# iteration. However, i want it to still iterate over it in the next iteration.
非常感谢!