Eryk Sun added the comment:
Terry, I assume you ran IDLE via pyw.exe or pythonw.exe, which won't inherit
the console of its parent. You have to use py.exe or python.exe. In this case
you can also use sys.__stdout__.write('spam\n').
If you run via pythonw.exe or pyw.exe from a command prompt, you could use
ctypes to attach to the console, but it would involve searching back to find
the cmd.exe or powershell.exe PID to call AttachConsole(pid). More simply you
can call ctypes.WinDLL('kernel32').AllocConsole() to get a new one.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29926>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com