[wingide-users] Errors when debugging wxpython?

F. GEIGER fgeiger at datec.at
Sat Nov 6 03:54:37 EST 2004


This is a wxPython issue. As it reads: You have to create the app obj first.
It could look like this:

if __name__ == '__main__':

   app = App()
   app.MainLoop()


And the app could look like this:

class App(wx.App):

   def OnInit(self):

      # Change to the app's directory
      s = PathName.FromString(sys.argv[0]).dn().__str__()
      _Logger.warn("Changing dir to '%s'. " % s)
      os.chdir(s)

      # Redirect stdou/stderr
      sys.stderr = open("stderr.log", "w")
      sys.stdout = open("stdout.log", "w")

      # Do the inits
      if __debug__:
         self._frame = MainFrame(None, -1)
         self._frame.Show(1==1)
         self.SetTopWindow(self._frame)
      else:
         wx.InitAllImageHandlers()
         try:
            splash = _SplashScreen()
            splash.Show()
         except Exception, e:
            self._frame = MainFrame(None, -1)
            self._frame.Show(1==1)
            self.SetTopWindow(self._frame)

      return 1==1

HTH
Franz GEIGER
 

> -----Original Message-----
> From: wingide-users-bounces at wingware.com 
> [mailto:wingide-users-bounces at wingware.com] On Behalf Of Gary Bishop
> Sent: Friday, November 05, 2004 8:56 PM
> To: Wing IDE Users
> Subject: [wingide-users] Errors when debugging wxpython?
> 
> Things appear to be working but I noticed in my Debug I/O 
> panel these messages on startup...
> 
> Traceback (most recent call last):
>   File "C:\src\ide\bin\2.3\src/debug/server\_wxhooks.pyc", 
> line 99, in _RegisterSocket
>   File "C:\Python23\lib\site-packages\wx\_misc.py", line 961, 
> in __init__
>     newobj = _misc_.new_Timer(*args, **kwargs)
> PyNoAppError: The wx.App object must be created first!
> Traceback (most recent call last):
>   File "C:\src\ide\bin\2.3\src/debug/server\_wxhooks.pyc", 
> line 99, in _RegisterSocket
>   File "C:\Python23\lib\site-packages\wx\_misc.py", line 961, 
> in __init__
>     newobj = _misc_.new_Timer(*args, **kwargs)
> PyNoAppError: The wx.App object must be created first!
> 
> Am I doing something wrong?
> 
> Thanks
> gb
> _________________________________________________
> Wing IDE users list
> http://wingware.com/lists/wingide
> 



More information about the wingide-users mailing list