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.
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.
even large, so reading in memory is OK. I just was curios.)