On May 25, 12:49 pm, cjl <[EMAIL PROTECTED]> wrote: > P: > > Stupid question: > > reader = csv.reader(open('somefile.csv')) > for row in reader: > do something > > Any way to determine the "length" of the reader (the number of rows) > before iterating through the rows? > > -CJL
How about: f = open("somefile.csv") numlines = len(f.readlines()) -- http://mail.python.org/mailman/listinfo/python-list