How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

Skip Montanaro skip.montanaro at gmail.com
Tue Jan 26 19:52:07 EST 2021


CW> How do you troubleshooting/debugging in Python?

GE> Mostly I read exception trace and read the code and think about it.
GE> If that doesn't work, I add some print() or syslog() calls.

CW> I know hardcore computer scientists would tell me about Python debugger.

GE> I've been writing Python for 20+ years. I've never tried a debugger.

Agree with Grant on these points. I certainly use gdb to debug C code
(like the interpreter), but for Python code, tracebacks and print
statements pretty much take care of things. I know pdb has been around
for a long while and many people like IDEs, but I've not generally
found them all that useful. I'm stuck in the 90s I guess.

Skip


More information about the Python-list mailing list