On Mon, Oct 22, 2012 at 3:28 PM, LZAntal <lzan...@gmail.com> wrote: > On Oct 22, 2012, at 12:20 PM, "Dewhirst, Rob" <robdewhi...@gmail.com> wrote: > >> import csv >> ifile = open('test.csv', "r") >> reader = csv.reader(ifile) > > I believe csv module uses iterator so you need to run reader.seek(0) between > the for loops
You have to reset the file iterator with ifile.seek(0). You might also want a new reader if you care about the line_num attribute, but otherwise you can keep using the same reader. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor