Sublime text 3 Python编译环境(win10)

2018-05-02  本文已影响204人  _大_兵_

1. 下载

2. Windows 10 安装配置Python环境

—– BEGIN LICENSE —– 
TwitterInc 
200 User License 
EA7E-890007 
1D77F72E 390CDD93 4DCBA022 FAF60790 
61AA12C0 A37081C5 D0316412 4584D136 
94D7F7D4 95BC8C1C 527DA828 560BB037 
D1EDDD8C AE7B379F 50C9D69D B35179EF 
2FE898C4 8E4277A8 555CE714 E1FB0E43 
D5D52613 C3D12E98 BC49967F 7652EED2 
9D2D2E61 67610860 6D338B72 5CF95C69 
E36B85CC 84991F19 7575D828 470A92AB 
—— END LICENSE ——

3. 安装python3编译环境

"encoding": "utf-8",  
"working_dir": "$file_path",  
"shell_cmd": "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python35-32\\python.exe -u \"$file\"",  
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",  
"selector": "source.python" 

注:按ctrl +b 是执行操作的命令,切记,切记,切记执行前要先保存文件。(这个和python自带的ide一毛一样,每次F5执行时都要先保存才行)

enter image description here

4. Sublime text 3 安装 package control

import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

如何安装插件:

查看已安装插件

5. Sublimetext 3 安装 python 的输入窗口: SublimeREPL

enter image description here
enter image description here

6. Sublime text 3 设置 python3 的快捷键

{  
  
"keys":["f5"],  
"caption": "SublimeREPL: Python - RUN current file",  
"command": "run_existing_window_command", "args": {"id": "repl_python_run",  
"file": "config/Python/Main.sublime-menu"}  
  
}  
enter image description here

7. SublimeCodeIntel代码提示插件

    "codeintel_language_settings": {
        "Python3": {
            "python3": "D:\\python-3.6.4\\python.exe",
            "codeintel_scan_extra_dir": [
                "D:\\python-3.6.4\\DLLs",
                "D:\\python-3.6.4\\Lib",
                "D:\\python-3.6.4\\Lib\\site-packages",
                "D:\\python-3.6.4\\Lib\\idlelib",
                "D:\\python-3.6.4\\",
                "D:\\python-3.6.4\\Lib\\*",
            ],
            "codeintel_scan_files_in_project": true,
            "codeintel_selected_catalogs": []
        },

8. 配置快捷键实现函数追踪、查看系统函数(暂不配置)

[//自动提示代码, [""]表示自动实现,不需要快捷键 
{ "keys": [""], "command": "code_intel_auto_complete" }, 
//跳转到函数定义 
{ "keys": ["alt+right"], "command": "goto_python_definition"}, 
//返回到跳转位置 
{ "keys": ["alt+left"], "command": "back_to_python_definition"} 
] 

9. 中文插件

10. 主题和侧边栏文件图标美化插件

 // Boxy Monokai
    "color_scheme": "Packages/Boxy Theme/schemes/Boxy Monokai.tmTheme",
    "theme": "Boxy Monokai.sublime-theme",

注:如果你的User配置文件原本为空,则需要在上述代码前后加上一对大括号{上述代码};如果已经有配置项,在加上上述两个配置项时,记得在前一个配置项后面加上英文逗号,,否则保存配置时会报语法错误。

11. Pylinter插件,Python语法检查
12. SublimeTmpl插件,新建以预设好的Python模板文件
13. Anaconda插件,Python终极插件
14. Python PEP8 Autoformat 代码格式更正。

其他参考

上一篇下一篇

猜你喜欢

热点阅读