Author eryksun
Recipients Mark, eryksun, louielu, martin.panter, njs, terry.reedy
Date 2017-06-29.17:36:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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.
Date User Action Args
2017-06-29 17:36:59eryksunsetrecipients: + eryksun, terry.reedy, njs, martin.panter, Mark, louielu
2017-06-29 17:36:59eryksunsetmessageid: <>
2017-06-29 17:36:59eryksunlinkissue29926 messages
2017-06-29 17:36:59eryksuncreate