opening sys.stdout in binary mode on Windows?

gbreed at cix.compulink.co.uk gbreed at cix.compulink.co.uk
Thu Oct 18 05:23:35 EDT 2001


In article <mailman.1003365858.22834.python-list at python.org>, 
janssen at parc.xerox.com (Bill Janssen) wrote:

> On Windows, I'd like to have stdout opened in binary mode before
> writing to it.  I've tried things like
> 
>    sys.stdout = os.fdopen(sys.stdout.fileno(), "wb")
> 
> without success.  Anyone know the trick?

Run as python -u


                      Graham




More information about the Python-list mailing list