【发布时间】:2016-06-30 01:51:05
【问题描述】:
with open(example.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
Do something.
我需要在 for 循环中每 10 行跳过一次,但是执行 readCSV[::10] 将不起作用。
【问题讨论】:
-
循环增加行数,如果 rowNum % 10 == 0.. 跳过