Grant Edwards wrote: > On 2007-07-25, Jeff McNeil <[EMAIL PROTECTED]> wrote: >> Depending on the size of your file, you can just use >> file.readlines. Note that file.readlines is going to read the >> entire file into memory, so don't use it on your plain-text >> version of War and Peace. > > I don't think that would actually be a problem for any recent > machine. > > The Project Gutenberg version of W&P is 3.1MB of text in 67403 > lines. I just did an f.readlines() on it and it was pretty > much instantaneous, and the python interpreter instance that > contains that list of 67403 lines is using a bit less than 8MB > of RAM.
YMMD :) Regards, Björn -- BOFH excuse #335: the AA battery in the wallclock sends magnetic interference -- http://mail.python.org/mailman/listinfo/python-list