Insert this line, where you want to debug your code:
>>> import pdb; pdb.set_trace()
pdb commands:
h - help
n - step
l - display where are you
s - step in
r - return
q - quit
p - print values
>>> import pdb; pdb.set_trace()
pdb commands:
h - help
n - step
l - display where are you
s - step in
r - return
q - quit
p - print values