When running Python's pdb as a script, how do I autostart the script? -
if want run script , have pdb catch exceptions come up, invoke so:
python -m pdb script.py or:
pdb script.py the problem stops @ debugging prompt right away:
> /home/coiax/junkyard/script.py(1)<module>() -> import sys (pdb) and have type c or continue go. there way of getting load , start script without asking if want set breakpoints or whatever?
i swear i've read pdb module documentation, , tried making .pdbrc file containing
c but doesn't start auto-magically.
what want can trivially achieved using ipython:
ipython yourmodule.py --pdb whenever exception raised not caught (i.e. program crashes), instantly land in ipython's debugger @ point exception raised. there on can move stack , down, inspect variables, etc. huge time saver when developing python; use time.
Comments
Post a Comment