Home >Development Tools >VSCode >How to run python files with vscode

How to run python files with vscode

王林
王林Original
2020-01-09 14:18:0712602browse

How to run python files with vscode

1. First, you need to ensure that the Python plug-in of VScode is installed. Open the Python script. You can drag it in directly, click on the file, and click on the user settings in the preferences. At this time, the user settings configuration will be displayed. document.

How to run python files with vscode

2. Then search for Python keywords in the left file Ctrl F and find the line where pythonPath is located

How to run python files with vscode

3. Then Copy the file where Python is located to the file on the right, pay attention to the direction of the slash, delete the trailing comma, and press Crtl+S after completion to save

How to run python files with vscode

4, and then switch to our program again file, Ctrl shift B to run the program. At this time, you will be prompted to configure the task runner, click Configure

How to run python files with vscode

5, and select Run any external command menu

How to run python files with vscode

6 . In the opened tasks.json file, two contents need to be modified, the path and the execution file name

How to run python files with vscode

7. After the final configuration is completed, the Python code can now be Ctrl shift B Directly ran

How to run python files with vscode

# Recommended related articles and tutorials: vscode tutorial

The above is the detailed content of How to run python files 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
Previous article:How vscode organizes codeNext article:How vscode organizes code