Some old programs were written by python2. This extension Support python2 code edit, debug, format. Semantic highlighting is not currently supported.
Modification
This extension is mainly based on ms-python.python tag2021.9.1246542782。Use old version python extension to support python2. Use old version open source jedi language server(0.17.2) instead of pylance.
We also made a Kylin Python(with jedi language server) extension to support python3. We deal with the conflictions between python3 and this(python2) extensions. You can view the python version in the status bar at the lower right corner. Click the version and the python interpreter will be displayed on the command line. Select python3 to switch to the python3 extension.(Although you have the ability to switch versions, to prevent problems, it is recommended that you manually disable other Python extension and reload the window.)
Support the launch.json template. You can click the Add configuration button when editing the launch
To prevent potential extension conflicts, users are advised to manually disable other Python extensions when utilizing this extension.
Quick start
Step 1. Install a supported version of Python on your system (note: that the system install of Python on macOS is not supported).
Step 2. Install the Kylin Python extension for IDE
Step 3. Open or create a Python file and start coding!
Set up your environment
Select your Python interpreter by clicking on the status bar
Configure the debugger through the Debug Activity Bar
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 IDE terminal.
Python: Run Python File in Terminal
Runs the active Python file in the IDE 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.
To see all available Python commands, open the Command Palette and type Python.
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
Environments: Automatically activate and switch between virtualenv, venv, pipenv, conda and pyenv environments
Supported locales
The extension is available in multiple languages: en, zh-cn eg