Video summary
How to debug in PyCharm (PyCharm debugger tutorial) [+ Common Mistakes !]
Main summary
Key takeaways
Tutorial Overview
This tutorial demonstrates how to use PyCharm’s debugger to follow Python code execution, inspect values, and investigate functions.
Breakpoints
Click the editor gutter beside a line to set or remove a breakpoint. When debugging, execution pauses before the marked line runs. The presenter starts a debugging session by right-clicking in the editor and selecting Debug.
Stepping Through Code
- Step Over (F8) runs the highlighted line and advances to the next one without entering functions called by that line. The presenter uses it to trace a loop that builds a list of doubled values.
- Step Into My Code enters functions and classes written by the developer.
- Step Into can also enter library or package code, such as Python’s
randommodule. - Step Out returns from the current function or library code.
Inspecting Values
The debugger’s Variables panel shows current variable values as the program runs. Evaluate Expression lets you test expressions in the current debugging context, such as converting range(1, 6) to a list or calculating i * 2.
You can also add expressions as watches to track their values across steps—for example, i * 3. The tutorial demonstrates adding watches with Ctrl+Shift+Enter, removing and reordering them, showing or hiding the evaluate field, and separating watches from the Variables panel.
Continuing Between Breakpoints
The presenter demonstrates continuing execution until the next breakpoint. Although the subtitles call this control “step out,” the described behavior is normally Resume Program, not Step Out.
Breakpoint on the First Line
The presenter reports that, in their test, a breakpoint on the first line caused PyCharm’s debugging to behave incorrectly. They found that adding a blank line before the code worked around the issue and reported no such problem in DataSpell or VS Code. This is the presenter’s observation, not a general guarantee.
Main speaker/source: A single presenter from the Koolac channel.
Rate this summary
Your feedback will help improve summaries.
Improve this summary
Reprocess with a stronger model when the summary feels incomplete or inaccurate.
Translate summary in another language
Ask questions to this video
Chat for follow-up questions, clarifications, and source-backed answers.