Python Editor - Sublime Text 3

Overview

  • 使用Sublime Text 3做Python开发
  • run in sublime text: Ctrl+B

SublimeCodeIntel

Preferences->Browse Packages->SublimeCodeIntel\.codeintel\config file
ctrl+shift+space

"Python": {
           "python":"D:/Programs/Python27/python.exe",
           "pythonExtraPaths":
            [
                 "D:/Programs/Python27",
                  "D:/Programs/Python27/DLLs",
                  "D:/Programs/Python27/Lib",
                  "D:/Programs/Python27/Lib/lib-tk",
                  "D:/Programs/Python27/Lib/site-packages"
             ]
}

Python PEP8 Autoformat

  • Python PEP8 Autoformat
  • CTRL+SHIFT+R: 按PEP8自动格式化代码
 {
     "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,
}

pylinter

Pylinter.sublime-settings 配置了pylinter 插件。
我使用下面的配置让 Pyhton 在保存时自动规范,并对违反规范显示图标。

{
    // Configure pylint's behavior
    "pylint_rc": "/Users/daniel/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
}

你可能感兴趣的:(Python Editor - Sublime Text 3)