[perl-python] 20050121 file reading & writing

Erik Max Francis max at alcyone.com
Sun Jan 23 18:46:02 EST 2005


Bob Smith wrote:

> To do this efficiently on a large file (dozens or hundreds of megs), you 
> should use the 'sizehint' parameter so as not to use too much memory:
> 
> sizehint = 0
> mylist = f.readlines(sizehint)

It doesn't make any difference.  .readlines reads the entire file into 
memory at once.

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   Can I lay with you / As your wife
   -- India Arie



More information about the Python-list mailing list