sublime 关于python的设置
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 }
SublimeCodeIntel 插件
智能提示插件,这个插件的智能提示功能非常强大,可以自定义提示的内容库,我的Python智能提示设置
"Python": { "python":"D:/Python27/python.exe", "pythonExtraPaths": [ "D:/Python27", "D:/Python27/DLLs", "D:/Python27/Lib", "D:/Python27/Lib/lib-tk", "D:/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, }
F12 或 CTRL+B 运行 py文件
如果是F12最好在py文件后加raw_input()否则CMD会一闪而过;
浙公网安备 33010602011771号