⬅ Back to Rob Mayoff's Site Index

python debugger script

Put this in a file named pdb in your $PATH and make it executable:

exec python "$(python -c 'import pdb; print pdb.__file__')" "$@"

Now if you want to run some Python script under the debugger, run pdb on it. For example, if you have a script named reverse.py that you want to run under the debugger:

$ pdb reverse.py
> <string>(1)?()
(Pdb) s
> /Users/mayoff/reverse.py(1)?()
-> class Node:
blog comments powered by Disqus