Pdb

Useage - Docs

You can use

import pdb
pdb.set_trace()

or New: as of 3.7 breakpoint()

breakpoint()

to enter debug mode.

Hidden gems

Use ! to escape default pdb commands like n(ext), c(ont(inue)) and h(elp)

>>> c = 1
>>> breakpoint()
--Return--
> <stdin>(1)<module>()->None
(Pdb) !c
1
(Pdb)