Starting python debugger automatically on error

python -m pdb -c continue myscript.py

If you don’t provide the -c continue flag then you’ll need to enter ‘c’ (for Continue) when execution begins. Then it will run to the error point and give you control there. As mentioned by eqzx, this flag is a new addition in python 3.2 so entering ‘c’ is required for earlier Python versions (see https://docs.python.org/3/library/pdb.html).

Leave a Comment