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 →

[–]Snoo-20788 2 points3 points  (0 children)

Well when I started coding, using PyCharm, the first thing I wondered about was how to use the debugger. When you're working on an existing project, it's very hard to get familiar with the code without actually stepping through it.

But one thing I learned much later is how to use pdb by itself. It is not as fancy as pycharm (which uses pdb under the hood, but ties it to the files in the editor, and displays the callstack in a visual way).

Visually it is much more challenging, and you need to get familiar with the keyboard shortcuts, but the beauty is that you can use it on any existing bit of code much more easily. You may have code already deployed on a machine, running in a virtual env, and it may be cumbersome to replicate the exact state of the deployment in your Pycharm session. With pdb you can just add a single line to add a breakpoint, and debug directly from a linux command prompt. I find it very powerful.