Python extension for Visual Studio Code
Перейти к файлу
Aaron Munger b1cb5c216c
dont execute history items (#24394)
fix https://github.com/microsoft/vscode-python/issues/24393
2024-11-05 13:25:10 -08:00
.config chore: use full names for CredScan false positives (#23255) 2024-04-17 15:22:09 -07:00
.devcontainer Move to Ruff for formatting (#23060) 2024-03-12 15:35:53 -07:00
.github Update node version to 20.18.0 (#24356) 2024-10-30 13:41:05 -07:00
.vscode Fix failing multiroot test (#24049) 2024-09-04 09:27:22 -07:00
build Update node version to 20.18.0 (#24356) 2024-10-30 13:41:05 -07:00
images Fix screenshot for open folder tile (#16890) 2021-08-09 13:01:16 -07:00
languages Introduce pip requirements file highlighting 2017-09-27 15:27:46 -07:00
pythonExtensionApi Update node version to 20.18.0 (#24356) 2024-10-30 13:41:05 -07:00
python_files disable shell integration for 3.13 (#24341) 2024-10-28 13:38:25 -07:00
resources Add locator for pixi environments (#22968) 2024-06-20 17:38:40 +00:00
schemas Remove uses of "master" (#13646) 2020-09-03 16:47:51 -07:00
scripts Fix Pyenv for Codespaces (#23315) 2024-05-01 14:01:16 -07:00
src error msg for adapter unalignment issue (#24385) 2024-11-04 13:36:13 -08:00
syntaxes Run prettier on our yaml, json and md files (#10871) 2020-04-01 10:19:44 -07:00
types Use new REPL notebook API (#24029) 2024-09-20 18:55:53 +00:00
typings Fix shell integration API reliability (#22446) 2023-11-08 23:20:29 +01:00
.editorconfig #1228 multi root master (#2) 2017-11-01 11:33:00 -07:00
.eslintignore Rename `pythonFiles` to `python_files` (#22921) 2024-03-01 13:27:50 -08:00
.eslintrc prevent test.only (#24235) 2024-10-03 14:17:28 -07:00
.git-blame-ignore-revs Ignore reformatting commits in `git blame` (#23063) 2024-03-13 10:54:58 -07:00
.gitattributes Update to Jedi 0.17 (#11252) 2020-04-21 10:16:35 -07:00
.gitignore Implementation of Test Coverage (#24118) 2024-09-18 08:33:28 -07:00
.npmrc Make gather an optional component (#9755) 2020-03-08 10:42:29 -07:00
.nvmrc Update node version to 20.18.0 (#24356) 2024-10-30 13:41:05 -07:00
.prettierrc.js Update files to match new Prettier settings (#15030) 2020-12-21 15:18:56 -08:00
.sonarcloud.properties Remove start page and its build dependencies (#16834) 2021-08-10 13:58:07 -07:00
.vscodeignore Clean up vsce package contents (#23718) 2024-06-27 18:24:06 +00:00
CHANGELOG.md Update CHANGELOG.md 2022-08-02 13:23:09 -07:00
CODE_OF_CONDUCT.md Have CoC match official template 2021-04-12 10:32:28 -07:00
CONTRIBUTING.md Update CONTRIBUTING.md 2021-04-13 16:34:09 -07:00
LICENSE Legal stuff to make CELA happy (#5) 2017-11-02 14:11:34 -07:00
README.md Rename REPL to Terminal REPL (#23613) 2024-06-17 13:43:32 -07:00
SECURITY.md Run prettier on our yaml, json and md files (#10871) 2020-04-01 10:19:44 -07:00
SUPPORT.md Add a SUPPORT.md file 2020-10-02 15:23:08 -07:00
ThirdPartyNotices-Repository.txt Revert "revert arg map change to remove from stable release (#23160)" (#23176) 2024-04-03 16:22:11 -07:00
cgmanifest.json Update cgmanifest (#19195) 2022-05-30 15:28:58 -07:00
gulpfile.js Remove debugger (#22502) 2024-01-09 12:26:32 -05:00
icon.png moved icon 2017-07-02 22:24:52 +10:00
noxfile.py Stable extension builds using `pet` from Azure Feed (#24063) 2024-09-06 10:48:39 -07:00
package-lock.json Update main to next pre-release (#24344) 2024-10-28 22:30:25 +00:00
package.json dont execute history items (#24394) 2024-11-05 13:25:10 -08:00
package.nls.json fix: tag non-stable settings with new system (#24287) 2024-10-11 11:51:13 -07:00
requirements.in Bump typing-extensions from 4.12.1 to 4.12.2 (#23583) 2024-06-13 18:03:04 +00:00
requirements.txt Bump tomli from 2.0.1 to 2.0.2 (#24229) 2024-10-03 14:22:47 -07:00
sprint-planning.github-issues Update the issue notebook (#19388) 2022-06-29 15:15:36 -07:00
tsconfig.browser.json Update to latest lsp for pull diagnostics (#23979) 2024-08-23 12:02:15 -07:00
tsconfig.extension.json Remove start page and its build dependencies (#16834) 2021-08-10 13:58:07 -07:00
tsconfig.json Update to latest lsp for pull diagnostics (#23979) 2024-08-23 12:02:15 -07:00
tsfmt.json Prettier 2020-02-20 10:45:04 -08:00
vscode-python-signing.csproj VS Python analysis engine integration (#1231) 2018-03-30 13:44:07 -07:00

README.md

Python extension for Visual Studio Code

A Visual Studio Code extension with rich support for the Python language (for all actively supported Python versions), providing access points for extensions to seamlessly integrate and offer support for IntelliSense (Pylance), debugging (Python Debugger), formatting, linting, code navigation, refactoring, variable explorer, test explorer, and more!

Support for vscode.dev

The Python extension does offer some support when running on vscode.dev (which includes github.dev). This includes partial IntelliSense for open files in the editor.

Installed extensions

The Python extension will automatically install the following extensions by default to provide the best Python development experience in VS Code:

  • Pylance - to provide performant Python language support
  • Python Debugger - to provide a seamless debug experience with debugpy

These extensions are optional dependencies, meaning the Python extension will remain fully functional if they fail to be installed. Any or all of these extensions can be disabled or uninstalled at the expense of some features. Extensions installed through the marketplace are subject to the Marketplace Terms of Use.

Extensibility

The Python extension provides pluggable access points for extensions that extend various feature areas to further improve your Python development experience. These extensions are all optional and depend on your project configuration and preferences.

If you encounter issues with any of the listed extensions, please file an issue in its corresponding repo.

Quick start

Set up your environment

  • 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

Jupyter Notebook quick start

The Python extension offers support for Jupyter notebooks via the Jupyter extension to provide you a great Python notebook experience in VS Code.

  • Install the Jupyter extension.

  • Open or create a Jupyter Notebook file (.ipynb) and start coding in our Notebook Editor!

For more information you can:

Useful commands

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 Terminal 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: 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. For Jupyter extension commands, just type Jupyter.

Feature details

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 or pytest.
  • Jupyter Notebooks: Create and edit Jupyter Notebooks, add and run code cells, render plots, visualize variables through the variable explorer, visualize dataframes with the data viewer, and more
  • Environments: Automatically activate and switch between virtualenv, venv, pipenv, conda and pyenv environments
  • Refactoring: Restructure your Python code with variable extraction and method extraction. Additionally, there is componentized support to enable additional refactoring, such as import sorting, through extensions including isort and Ruff.

Supported locales

The extension is available in multiple languages: de, en, es, fa, fr, it, ja, ko-kr, nl, pl, pt-br, ru, tr, zh-cn, zh-tw

Questions, issues, feature requests, and contributions

  • If you have a question about how to accomplish something with the extension, please ask on our Discussions page.
  • If you come across a problem with the extension, please file an issue.
  • Contributions are always welcome! Please see our contributing guide for more details.
  • Any and all feedback is appreciated and welcome!
    • If someone has already filed an issue that encompasses your feedback, please leave a 👍/👎 reaction on the issue.
    • Otherwise please start a new discussion.
  • If you're interested in the development of the extension, you can read about our development process.

Data and telemetry

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.