4

I'm fairly new to python and to date I've been using Komodo as my interpreter. I decided to try something more robust, so I installed Visual Studio Code version 1.23.1 and I'm running Python 3.6.4. When I run a basic script it runs properly, but I noticed in the debugger window none of the variables appear, in fact nothing appears. Not sure what I've done wrong. The debug is set to DEBUE Python: Current File.

1 Answer 1

4

By default VSCode's debugger will execute your file until it either encounters a breakpoint (or exception) or your program exits. To change this behavior, set "stopOnEntry": true your launch.json configuration like so:

"configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            // Add this line
            "stopOnEntry": true
        },
        // other configurations
        ...
}
Sign up to request clarification or add additional context in comments.

2 Comments

Ok, thank you! I swill make this change and see how it goes.
When I click F1 > Debug open launch.json > Select Environment - there is no python option, but node, chrome, edge.. Python is installed in c:/python, in the path and the python debugger extension also.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.