Besides wrapping all your code in try except, is there any way of achieving the same thing as running your script like python -mpdb script? I’d like to be able to see what went wrong when an exception gets raised.
Besides wrapping all your code in try except , is there any way of
Share
If you do not want to modify the source then yOu could run it from ipython – an enhanced interactive python shell.
e.g. run ipython then execute
%pdb onto enable post-mortem debugging.%run scriptnamewill then run the script and automatically enter the debugger on any uncaught exceptions.Alternatively
%run -d scriptnamewill start the script in the debugger.