It’s pretty simple to have your python script jump out to the debugger. Place these 2 lines right before where you want to start monitoring (otherwise, you’ll need to do a lot of stepping thru code).
import pdb
pdb.set_trace()
Some useful ones to remember are:
b
: set a breakpointc
: continue debugging until you hit a breakpoints
: step through the coden
: to go to next line of codel
: list source code for the current file (default: 11 lines including the line being executed)u
: navigate up a stack framed
: navigate down a stack framep
: to print the value of an expression in the current context