Home > Development Tools > VSCode > body text

How to run .py file in vscode

Release: 2020-01-10 15:48:15
Original
4820 people have browsed it

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}"]
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!