mohanraj-r
6/23/2015 - 12:41 AM

one line debugging aids

one line debugging aids

# inbuilt pdb
python -m pdb <script.py>
import pdb; pdb.set_trace()
import pdb; pdb.post_mortem() # invoke pdb after an exception has occurred ?

# with just iPython
from IPython.core.debugger import Tracer; Tracer()()

# after installing ipdb
import ipdb; ipdb.set_trace()

# after installing pudb
import pudb; pu.db

# tracing execution
# https://docs.python.org/2/library/trace.html
python -m trace --trackcalls <foo.py>