| Autor: Eduardo Enriquez

Using breakpoint with ipdb

Since Python 3.7 we have breakpoint() as a way of replacing the traditional import pdb; pdb.set_trace().

But if we use another third party library as pudb, ipdb, rpdb,  we can not use it.

But the PYTHONBREAKPOINT environment variable can be set to the name of a callable.

The way of using that environment variable is easy as exporting it:

export PYTHONBREAKPOINT=ipdb.set_trace
# or
export PYTHONBREAKPOINT=pudb.set_trace
export PYTHONBREAKPOINT=wdb.set_trace


# if we don't want to set the env we can also do:

PYTHONBREAKPOINT=ipdb.set_trace python3 main.py

Related Posts