Even with a comprehensive automated test suite, we can still get into situations where we need a debugger to figure out what's going on. Fortunately, Python includes a powerful debugger with the standard library: PDB. PDB is a command-line debugger, and if you're familiar with tools like GDB then you'll already have a good idea of how to use PDB.
The key advantage of PDB over other Python debuggers is that, being part of Python itself, PDB is available pretty much anywhere that Python is, including specialized environments where the Python language has been embedded into larger systems, such as ESRI's ArcGIS Geographical Information System. That said, it can be much more comfortable to use a
so-called graphical debugger, such as the ones included with products such as Jetbrains' PyCharm or Microsoft's Python Tools...