Menu

What do you use for debugging in Python?

Reddit r/learnpython·u/presentsq·7 months ago
#5eYxNmw4
#debugging#breakpoint#python#code#article
Reading 0:00
15s threshold

I've been using breakpoint() for debugging in all of my Python projects.
I really like it. You don't need to set up anything. You just write breakpoint() into your code, run the script, and it halts there. Then you can check variable values, continue when you are done.

This has been super useful not just for debugging but also for understanding other people's code.

But I've only ever used breakpoint() and I'm curious what else is a good approach.
What do you guys recommend?