printing bytes to stdout in Py3

Christian Heimes lists at cheimes.de
Tue Feb 17 19:28:47 CET 2009


Casey schrieb:
> On Feb 17, 12:33 pm, Christian Heimes <li... at cheimes.de> wrote:
>> Yes, it's really the official way. You can google up the discussion
>> between me and Guido on the python-dev list if you don't trust me. ;)
>> The docs concur with me, too.
>>
>> http://docs.python.org/3.0/library/sys.html#sys.stdin
>>
>> Note: The standard streams are in text mode by default. To write or read
>> binary data to these, use the underlying binary buffer. For example, to
>> write bytes to stdout, use sys.stdout.buffer.write(b'abc').
> 
> Thanks! Incidentally, the 'Note:' section you reference in the HTML
> docs doesn't appear to be in the .CHM file that installs with the
> windows version of 3.01.  That would have made my search a lot
> easier :-%

Oh, that should not happen. Please report this bug!

Christian




More information about the Python-list mailing list