Writing binary to stdout

Christopher T King squirrel at WPI.EDU
Wed Jun 23 21:06:04 CEST 2004

> Believe it or not, open('CON:','wb') actually works under WinXP. It's 
> amazing that this relic from DOS is still around. Though unportable (the 
> Unix equivalent is open('/dev/stdout','wb')) and ugly, it'll get the job done.

I correct myself. 'CON:' isn't really stdout, but rather the console. So 
this won't work if you connect stdout to something.

More information about the Python-list mailing list