If I want to run a script and have pdb
catch any exceptions come up, I invoke it like so:
python -m pdb script.py
Or:
pdb script.py
The problem is that it stops at the debugging prompt right away:
> /home/coiax/Junkyard/script.py(1)<module>()
-> import sys
(Pdb)
And I have to type c
or continue
to get it to go. Is there any way of getting it to just load and start the script without initially asking if I want to set any breakpoints or whatever?
I swear I've read the pdb
module documentation, and tried making a .pdbrc file containing
c
but it doesn't start auto-magically.
Changed in version 3.2: .pdbrc can now contain commands that continue debugging, such as continue or next. Previously, these commands had no effect.
I tried it with python 3.3, and it does exactly what you want as stated in your question. What version of python are you running?