I'm an idiot
Peter Hansen
peter at engcorp.com
Sat Jun 29 08:30:39 EDT 2002
Matt Gerrans wrote:
>
> Oops, silly me, it was posted, but I think there was a typo in it:
>
> > for line in open('c:/temp/temp.txt'):
>
> is missing the ".readlines()" part.
Under newer Pythons (2.2?) it's valid because the file object
will be treated as an iterator and do the equivalent of
xreadlines() (I think) automatically. Not the most readable,
perhaps, as written, but valid.
-Peter
More information about the Python-list
mailing list