Used to 'file = open(...)', now what?

Grzegorz Adam Hankiewicz gradha at titanium.sabren.com
Sun May 11 15:14:14 EDT 2003


On 2003-05-07, John Hunter <jdhunter at ace.bsd.uchicago.edu> wrote:
>   for line in file('somefile.dat'):
>       print line

Does this mean that the generator closes the file automatically
when it reaches the end?

-- 
 Please don't send me private copies of your public answers. Thanks.





More information about the Python-list mailing list