On 7 November 2010 18:14, Chris Rebert <c...@rebertia.com> wrote: > On Sun, Nov 7, 2010 at 9:56 AM, chad <cdal...@gmail.com> wrote: >> But what happens if the input file is say 250MB? Will all 250MB be >> loaded into memory at once? > > No. As I said, the file will be read from 1 line at a time, on an > as-needed basis; which is to say, "line-by-line".
IIRC, it's somewhere in between. Python will read the file in blocks. If only *looks* like it's reading the file line by line. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list