Shell re-direction

Jeff Epler jepler at unpythonic.net
Sun Mar 20 18:04:28 EST 2005


buffering.

In the first case, there is either no buffering, or line buffering on
sys.stdout, so you see the lines in order.

In the second case, there is a buffer of a few hundred or thousand bytes
for stdout in the python process, and you see the two lines of python
output together (in this case, when the python process exits and flushes
all its buffers).

You can use the "flush" method on file objects to "clear out" these
buffers.

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050320/f1e0d97c/attachment.sig>


More information about the Python-list mailing list