On 2013-05-16 14:07, Skip Montanaro wrote:
> > len(reader) gives me an error.
> 
> Apologies.  len(list(reader)) should work.  Of course, you'll wind
> up loading the entire CSV file into memory.  You might want to just
> count row-by-row:
> 
> n = 0
> for row in reader:
>     n += 1

which can nicely be rewritten as

  n = sum(1 for row in reader)

:-)

-tkc


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to