Probably a stupid question, but here it is. I developed an application that
runs OK under Linux, but using windows a separate logscreen appears that
closes when the application ends.
The application uses the logging module (new in Python 2.3), and I do not want
the separate window to appear, I want the output that is displayed in the
separate window to be processed by the logging module.
I have experimented with wxLog, but it doesn't do the things I want.
# redirect standard output
sys.stdout = utilswx.StreamRedirector( sys.stdout, self.Log )
where self.Log is a TextCtrl.
In message <200312271336.35863.dick.kniep@lindix.nl>, Dick Kniep <dick.kniep@lindix.nl> writes:
Hi List,
First of I wish you all a happy newyear!
Probably a stupid question, but here it is. I developed an application that
runs OK under Linux, but using windows a separate logscreen appears that
closes when the application ends.
The application uses the logging module (new in Python 2.3), and I do not want
the separate window to appear, I want the output that is displayed in the
separate window to be processed by the logging module.
I have experimented with wxLog, but it doesn't do the things I want.
Cheers,
--
D.J. Kniep
Lindix BV
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
Thanks, I have checked your solution, but by simply using the proper
statements in the logging module itself it worked already. So I simply was a
moron
However I am still curious why there is a difference between Windows and
Linux. Probably because the streams stderr and stdout are treated differently
under Windows and Linux.
Thanks, I have checked your solution, but by simply using the proper statements in the logging module itself it worked already. So I simply was a moron
However I am still curious why there is a difference between Windows and Linux. Probably because the streams stderr and stdout are treated differently under Windows and Linux.
The default value of the first parameter to wxApp.__init__ is dependent on platform. On Windows and Mac it will be True which will cause the redirection of sys.stdout and sys.stderr to a file like object that opens a window when there is data written to either of those files. On Unix the default is False and so there is no redirection.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!