1.下载python
在系统环境变量path下添加python.exe路径的环境变量
2.下载st3
3.安装package control
这里有两种方法:
- ctrl+`打开命令行(底部)粘切代码回车
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())
- 点击preferences>Browse packages菜单;进入Installed Packages目录;下载Pakage Control插件并解压到当前目录;重启st3。
2.安装插件SublimeREPL
Ctrl+shift+p 键入 install packages,搜索插件并安装
3.设置快捷键
{
"keys": ["f5"],
"caption": "SublimeREPL: Python - RUN current file",
"command": "run_existing_window_command",
"args":
{
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}
},
{
"keys":["f4"],
"caption": "SublimeREPL: Python - IPython",
"command": "run_existing_window_command",
"args":
{
"id": "repl_python_ipython",
"file": "config/Python/Main.sublime-menu"
}
}