Controlling newlines when writing to stdout (no \r\n).

Jeff Epler jepler at unpythonic.net
Mon Jan 3 21:04:38 EST 2005


Well, here's the first page turned up by google for the terms 'python
binary stdout':
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65443


Code from that page:
    import sys

    if sys.platform == "win32":
        import os, msvcrt
        msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)

Thanks, Google & the Python Cookbook website!

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050103/b80ada35/attachment.sig>


More information about the Python-list mailing list