Error messages when using the Console Module
Christian Heimes
lists at cheimes.de
Fri Feb 15 09:13:00 EST 2008
peter wrote:
> I am developing code using the effbot Console module, which gives
> control over the Windows terminal settings. My problem is that while
> this module redirects standard output to a new console window, it
> seems to redirect standard error messages to a black hole. So when my
> new code fails, I have no error messages to assist in diagnosing the
> problem. At times I have been reduced to writing new code a line at a
> time!
Windows GUI apps don't have valid standard streams. stdin, stdout and
stderr aren't connected and their fileno is -1. I guess you have to
connect the streams manually when you create a console window. C code
can use freopen() but I don't know how to properly redirect the streams
from Python.
MSDN has probably some docs for you.
Christian
More information about the Python-list
mailing list