Home >Development Tools >VSCode >How to run .py file in vscode

How to run .py file in vscode

尚
Original
2020-01-10 15:48:154934browse

How to run .py file in vscode

How to execute python program through vscode:

Configure tasks.json first:

Use the shortcut key "ctrl shift p" to open the search bar. Enter "Tasks: Configure Task Runner" to open tasks.json

{
    "version": "0.1.0",

    // The command is tsc. Assumes that tsc has been installed using npm install -g typescript
    "command": "C:/Python27/python.exe",

    // The command is a shell script
    "isShellCommand": true,

    // Show the output window only if unrecognized errors occur.
    "showOutput": "always",

    // args is the HelloWorld program to compile.
    "args": ["${file}"]
}

After the configuration is completed, use the shortcut key "ctrl shift B" to run the .py file.

Recommended related articles and tutorials: vscode tutorial

The above is the detailed content of How to run .py file in 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