Erik Max Francis <[EMAIL PROTECTED]> writes:
> This is really wasteful, as there's no point in reading in the whole
> file before iterating over it.  To get the same effect as file
> iteration in later versions, use the .xreadlines method::
> 
>       for line in aFile.xreadlines():
>           ...

Ehhh, a heck of a lot of web pages don't have any newlines, so you end
up getting the whole file anyway, with that method.  Something like

   for line in iter(lambda: aFile.read(4096), ''): ...

may be best.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to