for i, line in enumerate(lines):
testIDLines.append(line)
if line.find("TEXT") > 0:
for row in csvFile:
dosomething
if dosomething = True:
break
else:
continue
I have a small problem within this code - The first iteration works perfectly, but when I come into the second for loop another time the for row in csvFile
starts not at the start of the csvFile, but where it left the loop the last time.
csvFile Variable is a dictionary created with csvFile = csv.DictReader(open("Filename.csv"))
Is there a way to reset the csvFile variable to start from the first Row? Or how can this even happen, that the csvFile variable in this case gets touched when I make a for row in csvFile