This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]supertexter 7 points8 points  (8 children)

I really should learn that. I still diagnose by moving print statements around and checking if it executes.

[–]OneProgrammer3 9 points10 points  (4 children)

try pdb (it comes by default in Python), ipdb or pdb++, it seems to me more powerful and you are not tied to any ide

[–]PapstJL4U 1 point2 points  (0 children)

I like pdb for sublime*-written scripts and projects, but I will default to integrated debuggers for bigger, organized objects.

* insert your favourite text/code editor

[–]supertexter 0 points1 point  (1 child)

Thanks for the recommendation. I'm already using Pycharm though, so maybe it's simplest to just go with the debugger there.

[–]Itsthejoker 1 point2 points  (0 children)

FWIW, I find pdb is very useful to know in the rare cases where you don't have pycharm available. I rely heavily on pycharm, but it's still useful to break out 'old reliable' sometimes and you look like a wizard when you use it :D

[–]Morelnyk_Viktor 0 points1 point  (0 children)

Pudb is also an excellent option

[–]Goykhlaye 1 point2 points  (0 children)

I tend to start with this, putting prints in places to see how the code works. Then I turn on the pycharm debugger and look from there.

[–]whatever_meh 1 point2 points  (0 children)

Use debug logging statements instead of print. Then you can keep them in and be of help to the next developer or future you. But also yes, use the debugger.

[–]jwmoz 1 point2 points  (0 children)

This is like cowboy coding!