Tuesday, 3 September 2013

When running Python's pdb as a script, how do I autostart the script?

When running Python's pdb as a script, how do I autostart the script?

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 instantly goes:
> /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 automagically.

No comments:

Post a Comment