3

I'm new to python (and in coding in general). I'd like to ask some help to set up python on VS Code. I've tried to follow several guides but none of them were really helpful.

The following have been downloaded:

  • Python 3.6
  • VS Code
  • Python extensions
1
  • This is a very broad question and hard to answer. If you make some more progress on your own then perhaps you can instead post a question to specific problems that you encounter. Commented Feb 26, 2017 at 18:16

2 Answers 2

3

1) Install VS Code

2) Go to View > Command Palette

3) Type ext install and click on Install Extensions

4) Search for Python and install it

5) Reload VS

6) Start coding

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Zroq. Can you please explain these json files: launch, setting, tasks. Also, I've read many forums where they suggested to declare the path and setup these files.
2

This worked for me:

.vscode/settings.json:

{
    "python.linting.pylintEnabled": false,
    "python.pythonPath": "python.exe"
} 

.vscode/tasks.json:

{
    "version": "2.0.0"
}

.vscode/launch.json:

{
    "version": "2.0.0",
    "configurations": [
        {
            "name": "Python",
            "type": "python",
            "request": "launch",
            "stopOnEntry": false,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "cwd": "${workspaceRoot}",
            "console": "internalConsole",
            "debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit",
                "RedirectOutput"
            ]
        }    
    ]
} 

You can replace "program": "${file}", with "program": "${workspaceRoot}/main.py", to run your main file no matter which file you've selected but I found that that makes errors like syntax errors sometimes not display correctly if at all.

Breaking on exceptions

  1. Press CTRL + SHIFT + D
  2. In the BREAKPOINTS panel, click on Uncaught Exceptions enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.