Re: for line in file('filename'):

2007-07-24 Thread Steve Holden
Yoav Goldberg wrote: > > I use the idiom "for line in file('filename'): do_something(line)" quite > a lot. > > 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? > The file

for line in file('filename'):

2007-07-24 Thread Yoav Goldberg
I use the idiom "for line in file('filename'): do_something(line)" quite a lot. 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? Yoav -- http://mail.python.org/mailman/listinfo/python-list