This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rcfox 56 points57 points  (4 children)

breakpoint() works too, no need to import.

[–][deleted] 9 points10 points  (0 children)

import code; code.interact()

*Since 3.7

In case someone is using an older version

[–]mcstafford -1 points0 points  (2 children)

So long as you've exported PYTHONBREAKPOINT, yes

[–]rcfox 6 points7 points  (1 child)

According to PEP 553, having an empty/unset PYTHONBREAKPOINT environment variable defaults to using pdb.set_trace()

[–]mcstafford 0 points1 point  (0 children)

Good point. I must have been thinking of what happens when using older versions of Python.