码迷,mamicode.com
首页 > 编程语言 > 详细

sublime text之python

时间:2016-09-17 01:50:01      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

1、安装插件:

  ctrl+shift+p、install package、插件名称

2、直接运行python文件:

  ctrl+B

3、sublime text安装python:(链接:https://www.zhihu.com/question/22904994/answer/87527103)

  1、安装package control:

    View->Show Console

技术分享
1 import urllib.request,os; pf = Package Control.sublime-package; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), wb).write(urllib.request.urlopen( http://sublime.wbond.net/ + pf.replace( ,%20)).read())
View Code

    (可能会提示重启sublimetext)

    确认Preferences菜单有Package Settings和Package Control两个菜单;

技术分享
1 import urllib2,os; pf=Package Control.sublime-package; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), wb ).write( urllib2.urlopen( http://sublime.wbond.net/ +pf.replace(  ,%20 )).read()); print( Please restart Sublime Text to finish installation)
View Code

  2、安装sublimeREPL:

    Ctrl+shift+p

    install packages

    SublimeREPL 

    确认Tools->SublimeREPL->Python

  3、快捷键设置F1:

    Preferences->Key Bindings-User   

技术分享
1 [{"keys":["f1"],
2 "caption": "SublimeREPL: Python - RUN current file",
3 "command": "run_existing_window_command", "args":
4 {"id": "repl_python_run","file": "config/Python/Main.sublime-menu"}
5 }]
View Code

    ctrl+s

    之后可以直接F1执行。

sublime text之python

标签:

原文地址:http://www.cnblogs.com/jsir2016bky/p/5877735.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!