How to Rediret STDOUT

How can I redirect stdout to
wxTextCtrl ?

Lad

Hi Lad,

BMA TRADING wrote:

How can I redirect stdout to wxTextCtrl ?

I redirect stdout and stderr to a file:
        self.stdoutlog = file(r'stdoutlog.txt', 'a+')
        self.stderrlog = file(r'stderrlog.txt', 'a+')
        sys.stdout = self.stdoutlog
        sys.stderr = self.stderrlog

Then you can write them to your multiline textctrl.

        self.tctrlstdout.WriteText(self.stdoutlog.read())
        self.trctrlstderrlog.WriteText(self.stderrlog.read())
Hope this helps
Werner

ยทยทยท

Lad

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org