>1) How to change Ctrl-C behaviour? By default, pressing Ctrl-C in the
> terminal from which the wxPython app has been started causes the
> application to exit to shell. Is there any way to get the app to
> generate a KeyboardInterrupt exception instead, like a normal Python
> program? I frequently would like to stop my program in the middle of
> execution (say to find and debug an infinite loop), but can't do it
> because of this behaviour.
I've gone back and forth on this and have not found a better solution.
The current behaviour is how other X apps behave and so I thought it
best to stick with that. The other ways I have tried it resulted in
either the KeyboardInterrupt not being raised until after the MainLoop
exited, or in a segfault at exit, neigther of which seemed like a good
alternative to me.
Is there some workaround to cause the wxPython app to break at the currently
executing point? Any way to do this whatsoever? Occasionally I find that I
have chosen a menuitem which runs a function that runs for a longer period then
expected, and would like to debug where it is spending its time. Obviously
setting a breakpoint does not help with such intermittent behaviours.
>2) Is it me or are breakpoints set using 'pdb' simply ignored for
> wxPython apps?? For the life of me I can't find a way to debug
> wxPython programs, other than using inline "print" statements... what
> do I have to do to be able to "break" on a line and step through a
> running program??
>
It works for me, running pdb via the pdb mode in emacs. How do you run
pdb and set the breakpoint?
Well, I tried a number of methods, from commandline, ipython, and now emacs too
(although I haven't used pdb from Emacs before). This is for example how I try
to do it from the commandline:
% python -u /usr/lib/python2.3/pdb.py main.py
(main.py is my prog) I then do a few 's' commands to step into the main source
file, and then do "break main". The line number given for the breakpoint is
correct. But when I do "c" after that, the program doesn't stop at the
breakpoint, no matter where it has been set.
···
On Mon, Jan 05, 2004 at 03:17:10PM -0500, Robin Dunn wrote:
--
Maciej Kalisiak mac "at" dgp.toronto.edu www.dgp.toronto.edu/~mac