Is it possible to completely turn off this traceback-to-a-window
thing? I want them printed on stderr like normal...
I was hoping that..
class EditPag_App(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
wx.Log.SetActiveTarget(wx.LogStderr())
would do it, but it doesn't.
--Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
> Is it possible to completely turn off this traceback-to-a-window
> thing? I want them printed on stderr like normal...
>
> I was hoping that..
>
> class EditPag_App(wx.App):
>
> def OnInit(self):
> wx.InitAllImageHandlers()
>
> wx.Log.SetActiveTarget(wx.LogStderr())
>
> would do it, but it doesn't.
>
> --Stephen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Hm. See, my problem is that if its a fatal error, the window flashes
and the program terminates-- and I don't see the exception.
What i'd -really- like would be for it to output to stdio/stderr AND a
window... hmn.
Python exceptions don't get written to the wx.Log, but to sys.stderr, so to do something with exception messages you need to replace sys.stderr with some other class that has a write(text) method. wx.App uses wx.PyOnDemandOutputWindow to do it. If you like how it works but would just like to also write to the real stderr then you can do something like this:
class MyOnDemandOutputWindow(wx.PyOnDemandOutputWindow):
def write(self, text):
sys.__stderr__.write(text)
PyOnDemandOutputWindow.write(self, text)
class MyApp(wx.App):
outputWindowClass = MyOnDemandOutputWindow
def OnInit(self):
...
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!