4 ms·
You don't need this trickery. $ python -m pdb yourscript.py (Pdb) c Will let you inspect the local scope after an uncaught exception.
by hcarvalhoalves 13y ago
You don't need this trickery.
$ python -m pdb yourscript.py
(Pdb) c
Will let you inspect the local scope after an uncaught exception.
- davmre 13y agoYeah, that's probably a better general solution. That said, there are some contexts, e.g. working on academic research code which is always buggy, where you really do want debugger-on-exception to be the default behavior, so that you don't have to remember to type -m pdb every single time you run your code. I guess you could alias python to "python -m pdb", but that's opening a whole new can of worms. :-)