Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Python2 SupportNew to Visual Studio Code? Get it now.
Python2 Support

Python2 Support

Kylin-IDE Team

|
4,533 installs
| (0) | Free
Support python2 edit, debug, format.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

转到中文描述

Python2 Support

  • 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

english

Python2 Support插件

  • 支持 python2 代码编辑、调试、格式化文档。暂不支持语义高亮。
  • 修改
    • 本插件主要基于开源插件 ms-python.python tag2021.9.1246542782修改,使用旧版本的python扩展来支持python2。使用旧版本的开源jedi语言服务器(0.17.2)代替pylance。
    • 用开源的jedi语言服务代替pylance
    • 处理了与Kylin Python(with jedi language server)插件的冲突。右下角状态栏中可查看python版本,点击版本,命令行显示python解释器,如果安装了Kylin Python插件,选择python3版本可切换到python3插件(虽然具备切换版本功能,但为了避免出现问题,建议您手动禁用其他Python插件,并重启窗口。)
    • 提供launch.json模板,用户可在launch.json文件编辑时点击添加配置按钮进行配置
  • 为了防止潜在的插件冲突,建议用户在使用此插件时手动禁用其他Python插件。

快速开始

  • 步骤 1. 在您的系统上安装受支持的Python版本(注意:不支持macOS上的Python系统安装)。
  • 步骤 2. 安装Python插件。
  • 步骤 3. 打开或创建一个Python文件并开始编码!

设置环境

  • 通过单击状态栏选择Python解释器

  • 通过Debug活动栏配置调试器

可用命令

打开命令面板(macOS上是Command+Shift+P, Windows/Linux上是Ctrl+Shift+P),输入以下命令之一:

| 命令 | 描述 | | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Python: Select Interpreter | 在Python解释器、版本和环境之间切换。 | | Python: Start REPL | 在IDE终端中使用选定的解释器启动一个交互式Python REPL。 | | Python: Run Python File in Terminal | 在IDE终端中运行活动Python文件。您还可以通过右键单击该文件并选择在Run Python File in Terminal来运行该文件。 | | Python: Select Linter |从Pylint切换到Flake8或其他支持的lint。 | | Format Document | 使用settings.json文件中提供的formatter格式化代码。
要查看所有可用的Python命令,请打开命令面板并键入Python。

特性

了解更多关于Python插件的丰富功能:

  • 智能感知:编辑您的代码与自动完成,代码导航,语法检查以及更多

  • Linting:使用Pylint、Flake8等工具获得额外的代码分析

  • 代码格式化:使用black、autopep或yapf格式化代码

  • 调试:调试Python脚本、web应用程序、远程或多线程进程

  • 环境:自动激活和切换virtualenv, venv, pipenv, conda和pyenv环境

支持语言

插件支持多种语言:en,zh-cn等

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft