def a_long_function():
... # do some stuff
# Something is broken around here, we want to poke around, so we add this:
import pdb;pdb.set_trace()
... # other stuff
When we run the code, it stops at the import pdb;pdb.set_trace()
and gives us control over the program. We can rewrite the code as its executing!