Put sys.stdout into binary mode?

Discussion in 'Python' started by Grant Edwards, Jul 24, 2003.

  1. 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!!
    Grant Edwards, Jul 24, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roman Neuhauser
    Replies:
    0
    Views:
    644
    Roman Neuhauser
    Apr 4, 2005
  2. Replies:
    2
    Views:
    639
    velle
    Jan 5, 2006
  3. Replies:
    0
    Views:
    449
  4. Mitchell L Model

    sys.stdout vs. sys.stderr

    Mitchell L Model, Jan 11, 2010, in forum: Python
    Replies:
    2
    Views:
    553
    Nobody
    Jan 11, 2010
  5. Michel Albert
    Replies:
    5
    Views:
    1,356
    Daniel Dehennin
    Oct 24, 2012
Loading...

Share This Page