sublime text3安装python插件

背景:最近在学python,固测试了多种IDE工具。

目的:喜欢sublime的轻量,整理下常用的插件:

(linux先使用which python 记下安装路径)

1.给sublime3安装python

①.preferences

②.browse pa..

③.新建Python文件件

④.里面新建文件Python.sublime-commands

windows内容:

{

"cmd":["C:\python27\python.exe", "-u", "$file"],

"path":"C:\python27",

"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",

"selector": "source.python"

}

 

linux内容:

{

"cmd": ["/usr/bin/python","-u","$file"],

"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",

"selector": "source.python",

"encoding": "cp936",

}

⑤.tool->bulid system-->python

⑥.build

2.安装高亮插件: bracketHighlighter

 

 

 

3.安装语法检查:

windows增加环境变量path:C:\Python27

ctrl+shift+p

install pakeage

 

Anaconda

修改defualt的配置

"python_interpreter": "C:/Python27"

(用下面的直接替换)

修改user的配置

win10:

{

    "python_interpreter":"C:/python27/python.exe",

    "suppress_word_completions":true,

    "suppress_explicit_completions":true,

    "comlete_parameters":true,

    "swallow_startup_errors":true,

    "anaconda_linting":false

}

linux:

{

    "python_interpreter":"/usr/bin/python",

    "suppress_word_completions":true,

    "suppress_explicit_completions":true,

    "comlete_parameters":true,

    "swallow_startup_errors":true,

    "anaconda_linting":false

}

 

重启软件

4.高亮显示空格: TrailingSpaces

5.安装 SublimeREPL 

Tools->Build System->New build Systems

 

文件命名为python3.sublime-build

win10:

{

"cmd": ["C:Python27/python.exe","-u","$file"],

"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",

"selector": "source.python",

"encoding": "cp936",

}

linux:

{

"cmd": ["/usr/bin/python","-u","$file"],

"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",

"selector": "source.python",

"encoding": "cp936",

}

 

增加快捷键, Preferences->key bindings ,F5打开运行界面

[

 

{ "keys": ["f5"], "caption": "SublimeREPL: Python",

        "command": "run_existing_window_command", "args":

        {

            "id": "repl_python",

            "file": "config/Python/Main.sublime-menu"

        }

    }

]

增加快捷键,实现input操作(注意适当添加逗号)

{"keys":["Ctrl+r"],

"caption": "SublimeREPL: Python - RUN current file",

"command": "run_existing_window_command",

"args": {"id": "repl_python_run","file": "config/Python/Main.sublime-menu"}

}

 

6.AutoPep8 调整Python代码,使其符合PEP8的要求(ctrl+shift+8)。

 

7.设置默认使用python新建文件:

View … Syntax … Open all with current extension as … Python

Open the Command Palette and select "Package Control: Install Package", then search for DefaultFileType and you're done!

(安装DefaultFileType)

 

8.安装默认浏览器:SideBarEnhancements

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值