⬅ Back to Rob Mayoff's Site Index

python debugger script

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

#!/bin/bash
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
--Call--
> /Users/mayoff/reverse.py(1)?()
-> class Node:
(Pdb) 
blog comments powered by Disqus