Will file be closed automatically in a "for ... in open..." statement?
jfong at ms4.hinet.net
jfong at ms4.hinet.net
Tue Feb 16 23:04:14 EST 2016
More information about the Python-list mailing list
Tue Feb 16 23:04:14 EST 2016
- Previous message (by thread): Will file be closed automatically in a "for ... in open..." statement?
- Next message (by thread): Will file be closed automatically in a "for ... in open..." statement?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks for these detailed explanation. Both statements will close file automatically sooner or later and, when considering the exceptions, "with" is better. Hope my understanding is right. But, just curious, how do you know the "for" will do it? I can't find any document about it from every sources I know. Very depressed:-( --Jach
- Previous message (by thread): Will file be closed automatically in a "for ... in open..." statement?
- Next message (by thread): Will file be closed automatically in a "for ... in open..." statement?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list