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!