T wrote:
> Do I need to close the file in this case? Why or why not?
>
> for line in file('foo', 'r'):
> print line
I was running a program in IDLE that opened a file for
reading and forgot to add the close.
The program ran and terminated normally.
But when I tried to open it from Windows Explorer,
I got the message that it was still in use. Had to close
IDLE to release it. That wouldn't have happened if I had
closed it from within the program.
--
http://mail.python.org/mailman/listinfo/python-list