27 Star 2 Fork 3

openKylin/ide-python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

转到中文描述

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

  • 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

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环境

支持语言

插件支持多种语言:enzh-cn

Copyright (c) 2022 - present KylinIdeTeam MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
README
MIT
取消

发行版 (10)

全部
2个月前

近期动态

18小时前加入了仓库
18小时前加入了仓库
18小时前加入了仓库
2个月前推送了新的 v0.4.1 标签
2个月前推送了新的提交到 master 分支,2633069...8de142c
加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openkylin/ide-python.git
git@gitee.com:openkylin/ide-python.git
openkylin
ide-python
ide-python
master

搜索帮助