Reputation: 149594
What do you insert into Python source code to have it break into pdb (when execution gets to that spot)?
Upvotes: 31
Views: 13525
Reputation: 2097
As of Python 3.7, you can use breakpoint()
- https://docs.python.org/3/library/functions.html#breakpoint
Upvotes: 18
Reputation: 149594
import pdb; pdb.set_trace()
See Python: Coding in the Debugger for Beginners for this and more helpful hints.
Upvotes: 44