[Python] How do I step through code when debugging in VSCode?

Discussão em 'Python' iniciado por Stack, Julho 26, 2025.

  1. Stack

    Stack Membro Participativo

    I'm very new to debugging. My whole programming "career" has been limited to inserting print statements to try to figure out why things aren't working the way I want them to. Now I'm trying to step through my Python code in Visual Studio Code, but when I try to step into the debugger, it jumps straight to the first exception (which is like 50 steps in to be clear).

    I saw that there are debugging configurations, but surely I don't have to learn all about those just to step through the code. And I know you can set breakpoints, but I'd like to see each step for now. Is there something I'm missing? I was using IDLE to step through my somewhat simple function prior to trying VSCode, but all of the little tweaks made that way too slow. Thanks for any help you can provide.

    As best I can tell, this is the configuration I'm using by default:

    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    {
    "name": "Python: Current File",
    "type": "python",
    "request": "launch",
    "program": "${file}",
    "console": "integratedTerminal"
    }
    ]
    }

    Continue reading...

Compartilhe esta Página