Is pdb meant to be used as a cli tool or is this a special thing of Debian/Ubuntu?

#TIL that you can use pdb as a command line tool, at least on Ubuntu, as following…

pdb script.py

I certainly knew of python -m pdb and setting a breakpoint via breakpoint() or import pdb;pdb.set_trace(), but I was never aware of /usr/bin/pdb.

1 Like

As with most Python-related tools, python -m pdb is the preferred spelling, since that’ll always run with the Python version & environment as the python command. It is, after all using the python command.

The commands pdb, pdb3, pdb3.9 etc. are Debian-specific shortcuts, yes.

2 Likes