Sending binary data over CGI

Tim Roberts timr at probo.com
Tue Mar 9 01:30:57 EST 2004


Walter Huf <hufman at cobalty.com> wrote:
>
>
>>   import msvcrt
>>   ...
>>   msvcrt.setmode( stdout.fileno(), os.O_BINARY )
>
>Now, what would I do if I want to do the same in Unix/Linux?

That operation is entirely unnecessary in Unix/Linux, so you'd do something
like this:

    import sys
    ...
    if sys.platform == 'win32':
        import msvcrt
        msvcrt.setmode( stdout.fileno(), os.O_BINARY )
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list