Iteration on file reading
Andrew Dalke
adalke at mindspring.com
Thu Oct 2 19:22:54 EDT 2003
More information about the Python-list mailing list
Thu Oct 2 19:22:54 EDT 2003
- Previous message (by thread): Iteration on file reading
- Next message (by thread): Iteration on file reading
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Paul Watson
> for line in sys.stdin:
>
> Does this statement cause all of stdin to be read before the loop begins?
No. It will read a block of text at a time and break that block
into lines. This gives great performance and is scalable to
large files (so long as you can can afford to keep that extra
block around). However, it's lousy for interactive work.
Andrew
dalke at dalkescientific.com
- Previous message (by thread): Iteration on file reading
- Next message (by thread): Iteration on file reading
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list