dropping into the debugger on an exception

Jon Perez jbperez808 at yahoo.com
Wed Jun 9 16:41:36 CEST 2004

Thomas Heller wrote:

> Is the description in the cookbook unclear?  You do *not* have to add
> anything to your script - save the code as a file
> C:\Python23\sitecustomize.py and everything will work.  And you don't
> have to start the script from within pdb. The sitecustomize module is
> automatically imported when Python starts - if it is found.

Yes, I'm aware of this.  I don't want to add this to sitecustomize.py
because I don't want this happening all the time.

I was hoping to for a different strategy.  Would it be possible
to start up pdb(), call a script from there, give it the equivalent
of command line arguments, do a cont (or whatever is required) and
then have it /stay/ within pdb if an unanticipated exception occurs
(as opposed to having to set up a breakpoint)?

More information about the Python-list mailing list