Dear Rob,

This caught me out as well for a long time.

As I understand it, csv.reader is a file-reader, which iterates ONCE over the file. There may be more elegant solutions, but I do:

import csv
ifile = open('test.csv', "r")
reader = csv.reader(ifile)
inData = []
for row in reader:
        inData.append[row]      
ifile.close()

you can now loop through inData to your heart's desire.

HTH,

Matt
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to