[Tutor] use gzip with large files

Hugo González Monteverde hugonz-lists at h-lab.net
Tue Jul 19 23:02:02 CEST 2005


You're soooo right. missed that one, sorry...

Kent Johnson wrote:
> Hugo González Monteverde wrote:
> 
>>for a file-like object with a read method:
>>
>>for line in file:
>>     if not line:
>>         break
> 
> 
> The test
>   if not line:
>     break
> is not needed with this form of looping; the loop will end automatically when it gets to the end of the file.
> 
> 
>>line will be "" for EOF, "\n" for an empty line.
> 
> 
> No, you will not see the EOF in the loop, the loop will just terminate.
> 
> Kent
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 


More information about the Tutor mailing list