A Visual Studio Code extension with rich support for the Python language (for all actively supported versions of the language: 2.7, >=3.5), including features such as IntelliSense, linting, debugging, code navigation, code formatting, Jupyter notebook support, refactoring, variable explorer, test explorer, snippets, and more!
Select your Python interpreter by clicking on the status bar
Configure the debugger through the Debug Activity Bar
Configure tests by running the Configure Tests
command
For more information you can:
Open the Command Palette (Command+Shift+P on macOS and Ctrl+Shift+P on Windows/Linux) and type in one of the following commands:
Command | Description |
---|---|
Python: Select Interpreter |
Switch between Python interpreters, versions, and environments. |
Python: Start REPL |
Start an interactive Python REPL using the selected interpreter in the VS Code terminal. |
Python: Run Python File in Terminal |
Runs the active Python file in the VS Code terminal. You can also run a Python file by right-clicking on the file and selecting Run Python File in Terminal . |
Python: Select Linter |
Switch from Pylint to Flake8 or other supported linters. |
Format Document |
Formats code using the provided formatter in the settings.json file. |
Python: Configure Tests |
Select a test framework and configure it to display the Test Explorer. |
To see all available Python commands, open the Command Palette and type Python
.
Learn more about the rich features of the Python extension:
IntelliSense: Edit your code with auto-completion, code navigation, syntax checking and more
Linting: Get additional code analysis with Pylint, Flake8 and more
Code formatting: Format your code with black, autopep or yapf
Debugging: Debug your Python scripts, web apps, remote or multi-threaded processes
Testing: Run and debug tests through the Test Explorer with unittest, pytest or nose
Jupyter Notebooks: Define and run code cells, render plots, visualize variables through the variable explorer and more
Environments: Automatically activate and switch between virtualenv, venv, pipenv, conda and pyenv environments
Refactoring: Restructure your Python code with variable extraction, method extraction and import sorting
The extension is available in multiple languages thanks to external
contributors (if you would like to contribute a translation, see the
pull request which added Italian): de
, en
, es
, fr
, it
, ja
, ko-kr
, pt-br
, ru
, zh-cn
, zh-tw
The Microsoft Python Extension for Visual Studio Code collects usage
data and sends it to Microsoft to help improve our products and
services. Read our
privacy statement to
learn more. This extension respects the telemetry.enableTelemetry
setting which you can learn more about at
https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。