On 2009-03-26 01:41, Christian Heimes wrote:
> No, you are wrong. file.readlines() reads the entire file into memory
> and returns a list of strings. If you want to iterate over the lines of
> a text file you can simply write:
>
> for line in myfile:
>     dosomethingwith(line)
>
> It won't work for a binary file, though.

Thanks for the information! (In my case it's always text and not
even large, so reading in memory is OK. I just was curios.)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to