Launching pdb from within a script

Graham Nicholls graham at rockcons.co.uk
Sun Jan 4 20:27:03 CET 2004


Graham Nicholls wrote:

> Peter Otten wrote:
> 
>> Graham Nicholls wrote:
>> 
>>> A year or so ago, I was given a really useful answer to a question posed
>>> here, which showed me how to start the debugger from withing a script.
>> 
>> Are you looking for pdb.set_trace()?
>> 
>> Peter
> I think so, thanks!
> Graham
Or maybe not.
I'm sure I was able to print the value of variables like this:

 except : 
        pdb.set_trace()

run the program:
        error message
        (Pdb) d <return> (not sure why!)
        (Pdb) print dentry.path
        (Pdb) more debugging here

But pdb complains that there are no such variables.  It may be that I had to
add some incantation around the script startup - I just can't remember (and
its frustrating!).

Thanks
Graham
-- 
#include <wit>



More information about the Python-list mailing list