Redirecting stdin, stdout, and stderr to a window
Michael Fuhr
mfuhr at fuhr.org
Thu Dec 16 18:29:45 EST 2004
More information about the Python-list mailing list
Thu Dec 16 18:29:45 EST 2004
- Previous message (by thread): Redirecting stdin, stdout, and stderr to a window
- Next message (by thread): Legend problems in MatPlotLib
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Michael McGarry <replytogroup at nospam.org> writes: > How do I redirect stdin, stdout and stderr to a window? I am using Qt > for GUI. I don't know what specific mechanisms Qt provides, but the general solution is to write a class that implements I/O methods like read, readline, and write, and assign instances of that method to the input and output filehandles. For example, you could write a class with a write() method that displays text in a window, then assign an instance of that class to sys.stdout. Subsequent calls to 'print' would send output to the window. -- Michael Fuhr http://www.fuhr.org/~mfuhr/
- Previous message (by thread): Redirecting stdin, stdout, and stderr to a window
- Next message (by thread): Legend problems in MatPlotLib
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list