Home  >  Article  >  Development Tools  >  How to run python code with vscode

How to run python code with vscode

angryTom
angryTomOriginal
2020-02-10 17:40:269693browse

How to run python code with vscode

How does vscode run python code

Press Ctrl Shift B to run python code.

The premise is to configure taske.json

1. Press Ctrl Shift B and click

How to run python code with vscode

2 , click Create

How to run python code with vscode

3. Run external command

How to run python code with vscode

4. After creation, replace the content inside with (note The command should be changed to your own python installation path)

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "python",
            "type": "shell",
            "command": "C:/Users/FSITQD/AppData/Local/Programs/Python/Python36-32/python",
             "args": [
                "${file}"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

Then Ctrl Shift B will run.

Recommended related articles and tutorials: vscode tutorial

The above is the detailed content of How to run python code with vscode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn