您好,欢迎来到二三娱乐。
搜索
您的当前位置:首页Sublime 3 配置Python

Sublime 3 配置Python

来源:二三娱乐

最近开始学习Python,之前在学习latex的时候,就用了 sublime,配置的时候对我这个小白来说就是折磨啊。所以,我准备把过程记录下来,给大家参考。

下载安装Python和Sublime。

直接去官网下载,安装。

添加Path

首先在环境变量里添加两个软件的Path


配置

  • 先安装package control
    然后,再安装相关插件,具体如下:
  • 安装(这个我卸载了),Pylinter.sublime-settings 并配置了pylinter 插件。我使用下面的配置让 Pyhton 在保存时自动规范,并对违反规范显示图标。 注意:设置是在Preference>Package Settings>相应的Package>Settings - User 点开之后把代码输进去。
{
    // Configure pylint's behavior
    "pylint_rc": "/Users/你的用户名/dev/pylintrc",
 
    // Show different icons for errors, warnings, etc.
    "use_icons": true,
 
    // Automatically run Pylinter when saving a Python document
    "run_on_save": true,
 
    // Don't hide pylint messages when moving the cursor
    "message_stay": true
}
  • 安装SublimeCodeIntel 插件
    智能提示插件,这个插件的智能提示功能非常强大,可以自定义提示的内容库,我的Python智能提示设置
{"python":
{ "python":"C:/Python27/python.exe",
        "pythonExtraPaths":
            [
                "C:/Python27",
                 "C:/Python27/DLLs",
                 "C:/Python27/Lib",
                 "C:/Python27/Lib/lib-tk",
                 "C:/Python27/Lib/site-packages"
            ]
        }
    }
  • 安装Python PEP8 Autoformat 插件
    这是用来按PEP8自动格式化代码的。可以在包管理器中安装。快捷键 CTRL+SHIFT+R 自动格式化python代码
{
    "auto_complete": false,
    "caret_style": "solid",
    "ensure_newline_at_eof_on_save": true,
    "find_selected_text": true,
    "font_size": 11.0,
    "highlight_modified_tabs": true,
    "line_padding_bottom": 0,
    "line_padding_top": 0,
    "scroll_past_end": false,
    "show_minimap": false,
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": true,
    "wide_caret": true,
    "word_wrap": true,
}

Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务