very boring problem

Hi all
I'm new with Python/wxPython and I always have this
very boring problem.
Every time I run a code with an error, python
closes and I have no guess about what is wrong.

In particular I'm trying to find out how to
embed pyCrust in mine application,
I've found the code-snippet that follow,
that create a wxWindow and a PyCrust.
The program start, but when I try to
type something at the shell (also symply pressing enter)
it crashes.

If I run the program from inside a debugger,
I'm tryng HAP,IDLE,..., the debugger crashes too.

So, the question is :
How do you manage thes kind of problem,
there is a debugger that work ?

-- many thanks -- Silvano

···

-----------------------------------------------
import sys, os
from wxPython.wx import *
from wxPython.lib.PyCrust import shell
from wxPython.lib.PyCrust.crust import CrustFrame

class ShellFrame(wxFrame):
     def __init__(self, parent=None, id=-1, title='PyCrust Minimus'):
         wxFrame.__init__(self, parent, id, title)
         self.shell = shell(parent=self)

class App(wxApp):
     def OnInit(self):
         self.frame = ShellFrame()
         self.frame.Show(true)
         self.SetTopWindow(self.frame)
         return true

def main():
     application = App(0)
     application.MainLoop()

if __name__ == '__main__':
     main()
     raw_input()

This question has been asked quite a few times so, you might want to parse
older message chains with info about it :slight_smile:

But bottom line (at least what I do)

1) Open your dos shell, cd into the path where your file is and type: python
mywxfile.py . If it crashes you'll be able to see the traceback.

2) I use (and love) wing ide to debug everything and I particularly like it
for wx applications

Raul

···

----- Original Message -----
From: "Silvano Imboden" <s.imboden@cineca.it>
To: <wxPython-users@lists.wxwindows.org>
Sent: Wednesday, April 16, 2003 9:18 AM
Subject: [wxPython-users] very boring problem

Hi all
I'm new with Python/wxPython and I always have this
very boring problem.
Every time I run a code with an error, python
closes and I have no guess about what is wrong.

In particular I'm trying to find out how to
embed pyCrust in mine application,
I've found the code-snippet that follow,
that create a wxWindow and a PyCrust.
The program start, but when I try to
type something at the shell (also symply pressing enter)
it crashes.

If I run the program from inside a debugger,
I'm tryng HAP,IDLE,..., the debugger crashes too.

So, the question is :
How do you manage thes kind of problem,
there is a debugger that work ?

-- many thanks -- Silvano

-----------------------------------------------
import sys, os
from wxPython.wx import *
from wxPython.lib.PyCrust import shell
from wxPython.lib.PyCrust.crust import CrustFrame

class ShellFrame(wxFrame):
     def __init__(self, parent=None, id=-1, title='PyCrust Minimus'):
         wxFrame.__init__(self, parent, id, title)
         self.shell = shell(parent=self)

class App(wxApp):
     def OnInit(self):
         self.frame = ShellFrame()
         self.frame.Show(true)
         self.SetTopWindow(self.frame)
         return true

def main():
     application = App(0)
     application.MainLoop()

if __name__ == '__main__':
     main()
     raw_input()

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org