for line in file('filename'):

Yoav Goldberg yoav.goldberg at
Tue Jul 24 16:08:22 CEST 2007

I use the idiom "for line in file('filename'): do_something(line)" quite a

Does it close the opened file at the end of the loop, or do I have to
explicitly save the file object and close it afterward?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list