title: Print to standard console in curses
body: <p>I'm building a python curses application.</p>
  
  <p>I have two ways of printing to the curses window: <code>print x</code>, and <code>windows.addstr(x)</code> (and the other similar <code>window.*</code> options).</p>
  
  <p>However, for debugging purposes, I'd like to be able to print to the standard console, so when I exit the curses window, I have the infomation waiting for me to be seen. I would normally just use <code>print x</code>, but that prints to the curses window.</p>
  
  <p><code>sys.stout.write()</code> also fails.</p>
  
  <p>How can I do this?</p>
  
  <p>After using <code>sys.stdout</code> after <code>os.fdopen</code>, this is the traceback</p>
  
  <pre><code> curses.nocbreak()
   _curses.error: nocbreak() returned ERR
   close failed in file object destructor:
   sys.excepthook is missing
   lost sys.stderr
  </code></pre>