On Apr 13, 3:36 am, "7stud" <[EMAIL PROTECTED]> wrote:
>
> > It is if the file is smaller than the buffer size.
>
> How is that relevant?
>

If I put 100 lines of text in a file with each line having 50
characters, and I run this code:

import sys

lst = []
for line in open("aaa.txt"):
    print "an iteration"
    lst.append(line)
    break

print lst


The output is:

$ python test1.py

an iteration
['helleo haljdfladj ahdflasdjf ds hdljfalsdjfdsljfds \n']

It seems clear to me that the whole file wasn't first read into a
buffer before the code started processing the data.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to