This extension is now maintained in the Microsoft fork.
Branch: master
Clone or download
DonJayamanne Add status indicator for icons in test explorer (#4461)
* Add status indicator for icons
* Fix typo

* Fix tests
* Fixed tests

* Typo

* Code review comments

* Fixed tests

* Fixes
Latest commit f864c20 Feb 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Support debug configs (launch.json) for running tests. (#4372) Feb 20, 2019
.vscode Add ability to navigate to tests (#4289) Feb 6, 2019
build Attempt to fix CI build for functional on 2.7 (#4407) Feb 14, 2019
images Simplify/touch-up README (#8) Nov 7, 2017
languages Introduce pip requirements file highlighting Sep 27, 2017
news Fix precedence in `parsePyTestModuleCollectionResult` (#4360) Feb 20, 2019
pythonFiles Set up tests for the extension's Python files. (#4208) Feb 21, 2019
resources Add status indicator for icons in test explorer (#4461) Feb 21, 2019
schemas Add 'pip' to conda environment.yml schema (#2120) Aug 1, 2018
snippets Add snippet for `if __name__ == "__main__":` block (#2881) Oct 17, 2018
src Add status indicator for icons in test explorer (#4461) Feb 21, 2019
syntaxes Delete unused test language files (#298) Nov 27, 2017
tpn Bump the version number in the license metadata for ptvsd Feb 21, 2019
types Turn on tscompile strict mode for react code (#4134) Jan 25, 2019
typings Ensure code compiles in strict mode (#4044) Jan 18, 2019
.editorconfig #1228 multi root master (#2) Nov 1, 2017
.eslintrc fix #1276 Pre-commit hooks to ensure code complies with standards (#1277 Oct 12, 2017
.gitattributes Make npm happy in regards to line endings (#357) Dec 6, 2017
.gitignore Add coverage for unit tests and functional tests (#3651) Dec 12, 2018
.npmrc added .npmrc Oct 18, 2016
.travis.yml Fixes to smoke tests on CI (#4242) Jan 31, 2019
.vscodeignore Add coverage for unit tests and functional tests (#3651) Dec 12, 2018
CHANGELOG.md Merge release 2019.1.0 into master (#4198) Jan 29, 2019
CODE_OF_CONDUCT.md Legal stuff to make CELA happy (#5) Nov 2, 2017
CODING_STANDARDS.md Mention which style guide takes precedence and import practices Apr 10, 2018
CONTRIBUTING.md Add a build number to the rolling and release build (#4189) Jan 29, 2019
LICENSE Legal stuff to make CELA happy (#5) Nov 2, 2017
PYTHON_INTERACTIVE_TROUBLESHOOTING.md Update PYTHON_INTERACTIVE_TROUBLESHOOTING.md (#3385) Nov 17, 2018
README.md Update README for 2018.9.0 features Oct 18, 2018
ThirdPartyNotices-Distribution.txt Merge release 2019.1.0 into master (#4198) Jan 29, 2019
ThirdPartyNotices-Repository.txt Update TPN based on PyPI projects no longer being embedded in the rep… Dec 12, 2018
coverconfig.json Create localization of strings (#2757) Oct 9, 2018
gulpfile.js Fixes to smoke tests on CI (#4242) Jan 31, 2019
icon.png moved icon Jul 2, 2017
package-lock.json Preliminary live share support (just a simple cell running mirrored o… Feb 8, 2019
package.datascience-ui.dependencies.json Add the capability to support input in the Python Interactive window … Jan 21, 2019
package.json Add status indicator for icons in test explorer (#4461) Feb 21, 2019
package.nls.de.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
package.nls.es.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
package.nls.fr.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
package.nls.it.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
package.nls.ja.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
package.nls.json Added a button to configure unit tests when prompting users that test… Feb 12, 2019
package.nls.ko-kr.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
package.nls.nl.json Added Dutch language (#4012) Feb 11, 2019
package.nls.pt-br.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
package.nls.ru.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
package.nls.zh-cn.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
package.nls.zh-tw.json Simplify generation of launch.json with prompts (#3745) Dec 20, 2018
pvsc-dev-ext.py Explicitly find the full path to the executable being run (#3912) Jan 7, 2019
requirements.txt updated and news entry (#4458) Feb 20, 2019
tsconfig.datascience-ui.json Preliminary live share support (just a simple cell running mirrored o… Feb 8, 2019
tsconfig.extension.json Initial batch of changes to enable bundling of the extension (#3384) Nov 20, 2018
tsconfig.json Add Python Interactive Window (#3034) Oct 30, 2018
tsfmt.json #1228 multi root master (#2) Nov 1, 2017
tslint.json Fix issue causing debugger tests to timeout on CI servers (#4195) Jan 29, 2019
vscode-python-signing.csproj VS Python analysis engine integration (#1231) Mar 30, 2018
webpack.config.js Initial batch of changes to enable bundling of the extension (#3384) Nov 20, 2018
webpack.datascience-ui.config.js Fix icons in the insider build. Remove warning about extra command (#… Jan 3, 2019

README.md

Python extension for Visual Studio Code

A Visual Studio Code extension with rich support for the Python language (for all actively supported versions of the language: 2.7, >=3.4), including features such as linting, debugging, IntelliSense, code navigation, code formatting, refactoring, unit tests, snippets, and more!

Quick start

Optional steps

  • Step 4. Install a linter to get errors and warnings -- you can further customize linting rules to fit your needs.
  • Step 5. Select your preferred Python interpreter/version/environment using the Select Interpreter command.
    • By default we use the one that's on your path.
    • If you have a workspace open you can also click in the status bar to change the interpreter.
  • Step 6. Install ctags for Workspace Symbols, from here, or using brew install ctags on macOS.

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 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.

To see all available Python commands, open the Command Palette and type Python.

Supported locales

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

Questions, issues, feature requests, and contributions

  • If you have a question about how to accomplish something with the extension, please ask on Stack Overflow
  • 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 file a new issue
  • If you're interested in the development of the extension, you can read about our development process

Feature details

  • IDE-like features
    • Automatic indenting
    • Code navigation ("Go to", "Find all" references)
    • Code definition (Peek and hover definition, View signatures)
    • Rename refactoring
    • Sorting import statements (use the Python: Sort Imports command)
  • Intellisense and autocomplete (including PEP 484 and PEP 526 support)
    • Ability to include custom module paths (e.g. include paths for libraries like Google App Engine, etc.; use the setting python.autoComplete.extraPaths = [])
  • Code formatting
    • Auto formatting of code upon saving changes (default to 'Off')
    • Use either yapf, autopep8, or Black for code formatting (defaults to autopep8)
  • Linting
  • Debugging
    • Watch window
    • Evaluate expressions
    • Step through code ("Step in", "Step out", "Continue")
    • Add/remove breakpoints
    • Local variables and arguments
    • Multi-threaded applications
    • Web applications (such as Flask & Django, with template debugging)
    • Expanding values (viewing children, properties, etc)
    • Conditional breakpoints
    • Remote debugging (over SSH)
    • Google App Engine
    • Debugging in the integrated or external terminal window
    • Debugging as sudo
  • Unit testing
    • Support for unittest, pytest, and nose
    • Ability to run all failed tests, individual tests
    • Debugging unit tests
  • Snippets
  • Miscellaneous
    • Running a file or selected text in python terminal
    • Automatic activation of environments in the terminal
  • Refactoring
    • Rename refactorings
    • Extract variable refactorings
    • Extract method refactorings
    • Sort imports

General Features

Debugging

Unit Tests

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.