Iteration on file reading

Jeremy Fincher tweedgeezer at hotmail.com
Sat Oct 4 06:29:59 EDT 2003


"Paul Watson" <pwatson at redlinec.com> wrote in message news:<3f7ca9ea$1_1 at themost.net>...
> for line in sys.stdin:
> 
> Does this statement cause all of stdin to be read before the loop begins?
> 
> I may need to read several GB and I do not want to swamp the machine's
> memory.

Have you considered simply inputting this into an interactive
interpreter and seeing if it swamps the machine's memory?

Jeremy




More information about the Python-list mailing list