Thanks Robin,
I’ve solved the problem. I did a callback on a printing function and it worked.
Regards,
Radu.
···
----- Original Message ----
From: Robin Dunn robin@alldunn.com
To: wxPython-users@lists.wxwidgets.org
Sent: Wednesday, 8 August, 2007 12:20:51 AM
Subject: Re: [wxPython-users] connect an application with a wx GUI
Radu Ciora wrote:
I also tried to redirect the printing as in the example in wxPython In
Action like this:
app = MyApp(redirect=True)
but instead of printing in my window it prints to the another window
called “wxPython: stdout/stderr”
Is possible to redirect to my window?
Any object with a write() method can be used for the stdout files in
Python, that’s how the window you are seeing now works. So to have it
go to your own window you simply need to have some object that has a
method like this:
def write(self, msg):
# do something with msg
and it can do whatever you need it to do. To hook it up to Python’s
stdout just assign an instance of this class to sys.stdout, and also to
sys.stderr if you want to see things like exception tracebacks in your
window too.
–
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with
wxPython!
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Yahoo! Mail is the world’s favourite email. Don’t settle for less, sign up for your free
account today.