fredrik at pythonware.com
Fri Aug 29 21:37:30 CEST 2008
Glenn Hutchings wrote:
> Have you checked memory usage while your program is running? Your
> lines = f.readlines()[2:]
> statement will need almost twice the memory of your largest file.
footnote: list objects contain references to string objects, not the
strings themselves. the above temporarily creates two list objects, but
the actual file content is only stored once.
More information about the Python-list