Interactive unbuffered STDOUT

Rupert Kolb rupert.kolb at med.uni-tuebingen.de
Wed Dec 12 06:17:13 EST 2001


Kevin Smith wrote:

> Is there a way that sys.stdout can be switched to unbuffered during execution? 

 > I know that you can set the PYTHONUNBUFFERED environment variable 
or > use the -u option, but those have to be done before the interpretter
 > is loaded.
 >
 > I see that there is a bufsize option on the open() function.  If I
 > could recreate sys.stdout with bufsize=0, that would be great.

[...]


I'm interested in this too.

I would like to mix (the normal) buffered print mode with
unbuffered (print / sys.stdout.write) mode in an easy way.

-- 
Rupert Kolb





More information about the Python-list mailing list