pdb – The Python Debugger
Debugging with pdb
Very first thing, read this blog by Steve Ferg’s which explains pdb in details.
Here are the summary of the necessary commands:
setting up break points by pdb.set_trace()
- n (next) - ENTER (repeat previous) - q (quit) - p <variable> (print value) - c (continue) - l (list where you are) - s (step into subroutine) - r (continue till the end of the subroutine) - ! <python command>