[This may or may not be wxPython related. It's
happening in a wxPython app and I've not seen
it in a non-wxPython python app]
I wonder if anyone can shed any light on this.
Environment is Win2000 and wxPython 2.3.3.1
I have a program written in wxPython and which I am
"compiling" to a .exe using py2exe. My program
does some debug logging using "print" (going to the
console window that the py2exe environment provides).
But if I suppress the console window using the -w
flag to py2exe, the program hangs from time to time
and has to be killed. Removing some of the print
commands seems to help.
Are there known issues with printing in a py2exe'd
wxPython app when the console window is suppressed?
Some internal queue filling up perhaps?
[This may or may not be wxPython related. It's
happening in a wxPython app and I've not seen
it in a non-wxPython python app]
I wonder if anyone can shed any light on this.
Environment is Win2000 and wxPython 2.3.3.1
I have a program written in wxPython and which I am
"compiling" to a .exe using py2exe. My program
does some debug logging using "print" (going to the
console window that the py2exe environment provides).
But if I suppress the console window using the -w
flag to py2exe, the program hangs from time to time
and has to be killed. Removing some of the print
commands seems to help.
The printing still happens, and probably the stdout buffer is filling since the data is not being consumed. You chould instead use the built in wxPyOnDemandOutputWindow to send your print statements to a wxWindow. It works by setting sys.stdout and sys.stderr to an object that has a write method that send the data to the window instead of the file objects. To turn it off you could just replace sys.stdout and sys.stderr with an object that has a write(string) method that does nothing. See wx.py for more details.
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
The printing still happens, and probably the stdout buffer is filling
since the data is not being consumed. You chould instead use the built
in wxPyOnDemandOutputWindow to send your print statements to a wxWindow.
Thanks Robin. It did seem rather like a buffering
issue. I will look into wxPyOnDemandOutputWindow.