Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure VSCode to run python

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to configure VSCode to run python". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to configure and run python in VSCode".

Preparation stage

First install the corresponding VSCode and python interpreters, and then install the following plug-in.

Pylance is a new python plug-in from Microsoft, which is used to replace the original python plug-in. With this plug-in, you can run python code in VSCode.

Search for pylance in the expansion store, click install, and restart VSCode.

Project creation and configuration

Create a new folder, open it with VSCode, and then create a new py code file (take hello world as an example).

Click Select Python Interpreter at the bottom to select your own python environment.

After the selection is completed, a .vscode folder will appear in the project directory, and a setting.json file will appear in it, with the following structure:

{"python.pythonPath": "C:\\ Program Files\\ Python39\ python.exe"}

If you need to change the interpreter, you can change the above interpreter path to the interpreter path you need.

Running

Once you have configured the python interpreter, you can run the python file.

Click the run button in the upper right corner (green triangle) and the code will run.

Thank you for reading, the above is the content of "how to configure and run python in VSCode". After the study of this article, I believe you have a deeper understanding of how to configure and run python in VSCode, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report