By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,575 Members | 1,395 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,575 IT Pros & Developers. It's quick & easy.

Redirecting stdin, stdout, and stderr to a window

P: n/a
Hi,

How do I redirect stdin, stdout and stderr to a window? I am using Qt
for GUI.

Thanks,

Michael
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Michael McGarry <re**********@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/
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.