Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Redirecting stdin, stdout, and stderr to a window

Reply
Thread Tools

Redirecting stdin, stdout, and stderr to a window

 
 
Michael McGarry
Guest
Posts: n/a
 
      12-16-2004
Hi,

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

Thanks,

Michael
 
Reply With Quote
 
 
 
 
Michael Fuhr
Guest
Posts: n/a
 
      12-16-2004
Michael McGarry <(E-Mail Removed)> 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirecting stderr and stdout to syslog Lincoln Yeoh Python 2 08-06-2008 01:44 AM
Redirecting stderr to null and revert reubendb Python 1 08-07-2007 09:42 AM
script hangs when run from command line and redirecting stdout and stderr to file it_says_BALLS_on_your forehead Perl Misc 2 01-10-2006 11:31 AM
redirecting stderr and stdout Jon Landenburer Perl 1 05-13-2004 07:38 AM
Redirecting Python stdout ,stderr and stdin Jan Knop Python 4 11-24-2003 10:14 AM



Advertisments