[Tutor] print stack traces not caused by errors

Alex Hall mehgcap at gmail.com
Wed Jan 5 01:06:09 CET 2011


Thanks to both of you. While I am not getting as much information from
pdb as I get from an error traceback, I suspect that it is my fault
and I will figure out how to get more. I will definitely look at
setting breakpoints in the event handlers (every event is fired by a
keystroke controled in an accelerator table). It is one of those
problems that is hard to track down since it seems to happen randomly,
though there is, of course, some set of circumstances causing the
problem that I cannot figure out. I will get it eventually...
hopefully!

On 1/4/11, Alan Gauld <alan.gauld at btinternet.com> wrote:
>
> "Alex Hall" <mehgcap at gmail.com> wrote
>
>> expected at all. I tried the pdb module, but I am running a wx
>> program
>> so it is not helping. I tried:
>> python -m pdb c:\prog\solitaire\game.py
>
> The key to using any debugger in a GUI environment is to set break
> points on the event handlers of interest. Then when the event fires
> the debugger will stop your code at the start of the event handler
> and you can examine the stack, variables etc and step through
> the code.
>
> Single line stepping is tiresome so usually you are better off
> setting another break point within the function (just before or within
> a loop maybe? Or after reading a line from a file...). A watch point
> is even better but sadly I don't think pdb supports those. But
> the debugger in Eclipse and winPDB(?) do I think.
>
> And of course print statements work too within the console
> window.
>
> HTH,
>
> Alan G.
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>


-- 
Have a great day,
Alex (msg sent from GMail website)
mehgcap at gmail.com; http://www.facebook.com/mehgcap


More information about the Tutor mailing list