debug
add everywhere in your code to get to a debug prompt
import pdb pdb.set_trace()