转到中文描述
Kylin Python (with jedi language server)
- Support python3 code edit, debug, format
- This extension is mainly based on open source ms-python.python,ms-python.debugpy.
- version <= 0.2.6 is based on ms-python.python tag2022.8.1
- version > 0.2.6 is based on ms-python.python tag2024.2.1,ms-python.debugpy tag2024.0.0
- Modification
- this extension merged together ms-python extension set
- use open source jedi language server instead of pylance
- python3.12 supported
- Support python semantic highlighting, porting ms-python.debugpy tag2024.0.0 and other extensions for debugging, linting, formatting functions based on ms-python.python tag2024.2.1 extension
- We also made a python2 support extension. We deal with the conflictions between python2 and this(python3) 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 python2 to switch to the python2 extension if you installed python2 support 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
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
english
Kylin Python 插件
- 支持 python3 代码编辑、调试、格式化文档
- 本插件主要基于开源插件 ms-python.python、 ms-python.debugpy修改
- 版本 <= 0.2.6 基于 ms-python.python tag2022.8.1修改
- 版本 > 0.2.6基于 ms-python.python tag2024.2.1, ms-python.debugpy tag2024.0.0修改
- 修改
- 本插件合并了ms-python插件集
- 用开源的jedi语言服务代替pylance
- python3.12亦可支持
- 支持python语义高亮,基于ms-python.python tag2024.2.1插件移植ms-python.debugpy tag2024.0.0等其他插件的调试、linting、格式化功能
- 为了支持python2,我们制作了python2 support插件,处理了python2 support插件和此插件的冲突。右下角状态栏中可查看python版本,点击版本,命令行显示python解释器,如果安装了python2 support插件,选择python2版本时可切换到python2插件(虽然具备切换版本功能,但为了避免出现问题,建议您手动禁用其他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
| |