Grant Edwards wrote:
When I ssh in to my Windows XP box and run Python apps, output
from "print" and and "sys.stdout.write()" is being buffered so
that none of the output shows up until the program exits.
From within my program how do I set output buffering to either
line-buffered or un-buffered? [I'm looking for the equivalent
of the C stdio "setbuf" call.]
I'm not sure you can do that from within the program [1]; to do it from
the outside, set the PYTHONUNBUFFERED environment variable to something,
or pass "-u" to the interpreter.
</F>
1) well, I suppose you could replace sys.stdout with a thin wrapper that
does flush after each write, or play with os.fdopen.
--
http://mail.python.org/mailman/listinfo/python-list