How do you break into the debugger from Python source code?
import pdb; pdb.set_trace()
See Python: Coding in the Debugger for Beginners for this and more helpful hints.
As of Python 3.7, you can use breakpoint()
- https://docs.python.org/3/library/functions.html#breakpoint