Put sys.stdout into binary mode?

Grant Edwards grante at visi.com
Thu Jul 24 13:17:12 EDT 2003


How do I make sure that sys.stdout (or sys.stdin) is in
"binary" mode?

This seems to work, is it the "right" way of doing it?

  sys.stdout = os.fdopen(sys.stdout.fileno(),'wb')

-- 
Grant Edwards                   grante             Yow!  -- I can do
                                  at               ANYTHING... I can
                               visi.com            even... SHOPLIFT!!




More information about the Python-list mailing list