What do you insert into Python source code to have it break into pdb (when execution gets to that spot)?
2 Answers
import pdb; pdb.set_trace()
See Python: Coding in the Debugger for Beginners for this and more helpful hints.
2 Comments
Daryl Spitzer
From the FAQ: > It's also perfectly fine to ask and answer your own programming question, but pretend you're on Jeopardy: phrase it in the form of a question.
Mawg
How would that work in an IDE? It doesn't work in Pycharm
As of Python 3.7, you can use breakpoint() - https://docs.python.org/3/library/functions.html#breakpoint