Let's talk about debuggers!

Ned Batchelder ned at nedbatchelder.com
Wed Oct 25 09:53:10 EDT 2017


On 10/25/17 9:07 AM, Thomas Jollans wrote:
> Hi,
>
> I just wanted to know what tools everyone used for debugging Python
> applications - scripts / backend / desktop apps / notebooks / whatever.
> Apart from the usual dance with log files and strategically inserted
> print() calls, that is.
>
> Of course we all know and mildly dislike pdb.
>
> Personally, in practice, I'm most likely to need a debugger when
> prototyping a function in a Jupyter notebook. There, ipdb, summoned with
> the %%debug magic incantation, does the trick.
>
> Sometimes, though, I miss having a visual debugger. You know, the kind
> that Visual Basic has had for decades. There's one in Chrome dev tools
> if you ever have the misfortune of writing JavaScript.
>
> What options are there for Python (that work)? What text editors (and
> IDEs) have a decent integrated debugger or debugging plugin? (Is there
> anything for Sublime?) Does anyone use them? (How do YOU debug?)
>
> I vaguely remember WinPDB, but that hasn't seen a release in more than
> seven years...
>
>

pudb is a visual terminal debugger: https://pypi.python.org/pypi/pudb

It uses the same commands as pdb, so it's easy to get started, but it 
gives you a variables pane, with customizable presentation, and so on.

One of my favorite features: you can add a set_trace line in your 
program, and then if during the debugging session you realize you don't 
want to stop there every time, you can disable that breakpoint even 
though it's an explicit line of code telling the debugger to stop.

--Ned.



More information about the Python-list mailing list