Ubuntu 16.04下指定Sublime Text 3 默认python编译版本
2016-06-19 17:10
519 查看
安装PackageResourceViewer插件
输入
Ctrl+Shift+P
输入
install,选择
Package Control: Install Package
选择
PackageResourceViewer,安装
设置默认的 Python.sublime-build
输入
Ctrl+Shift+P
输入
resource,选择
PackageResourceViewer:Open Resource
再选择
Python,再再选择
Python.sublime-build
编辑
Python.sublime-build将
"shell_cmd": "python -u \"$file\"",改为以下之一:
"shell_cmd": "python3 -u \"$file\"", //指定python3为.py默认编译器
"shell_cmd": "python2 -u \"$file\"", //指定python2为.py默认编译器
"shell_cmd": "python -u \"$file\"", //根据Ubuntu系统设置,看/usr/bin/python链接哪儿(ln)
"shell_cmd": "指定版本python的绝对路径 -u \"$file\"", //指定路径下的python编译器
使用python3的配置文件示例(Python.sublime-build)
{ //"shell_cmd": "python -u \"$file\"", "shell_cmd": "python3 -u \"$file\"", //指定python3为.py默认编译器 "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python", "env": {"PYTHONIOENCODING": "utf-8"}, "variants": [ { "name": "Syntax Check", "shell_cmd": "python -m py_compile \"${file}\"", } ] }
呵呵,方便、顺眼多了
与其他方法的使用比较
网上也有其他变通方法,可以参考下面链接:个人感觉:
相关文章推荐
- Python字典的内置方法
- python开发环境搭建 (eclipse)
- python3实现读取chrome浏览器cookie
- python中splite()返回值
- Python-zip函数
- python3 实现的人人影视网站自动签到
- Python的字节编译
- __setattr__,setattr(),getattr__,getattr()及__getattribute__的区别
- Python-第三方库requests详解
- Python列表的内置方法
- python3 sorted的用法
- Python 字符串
- word frequency counter python 页面词汇频率小代码
- python基础篇-day1
- Python实现学校学生管理系统的自动登录
- python 统计单词个数---从文件读取版本---不去重
- 机器学习实战笔记3(决策树与随机森林)
- Python Channels笔记--Deploying
- Python Requests快速入
- Python2.7中的super方法浅见