配置sublime3的Anaconda 插件进行Python 代码的自动补全功能
1.安装anaconda插件
使用快捷键ctrl+shift+p打开命令面板,输入install,面板上第一项应该会出现Package Control: Install Package
然后进行安装anaconda
2.配置anaconda
修改Preference--Package Setttings--Anaconda--Settings Default文件
修改python_interpreter 的路径,指定python的安装路径
例如:"python_interpreter": "E:/python3/python3.exe"
3.配置自定义的anaconda
Preference--Package Setttings--Anaconda--Settings User
{
"python_interpreter": "E:/python3/python3.exe",
"suppress_word_completions": true,
"suppress_explicit_completions": true,
"complete_parameters": false,
"anaconda_linter_phantoms": true,
"pyflakes_explicit_ignore":
[
// "Redefined",
"UnusedImport"
// "UndefinedName",
// "UndefinedLocal",
// "UnusedVariable,",
// "UndefinedExport",
// "DuplicateArgument",
// "RedefinedWhileUnused"
],
"anaconda_linting_behaviour": "save-only",
}
配置sublime3的python开发环境
1.创建配置文件
Tools-Build System-New Build System
然后填写如下内容指定python的路径:
{
"cmd": ["E:/python3/python3.exe","-u","$file"],
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
"selector": "source.python",
}
保存文件名为python3 然后选择Python3的开发环境Tools-Build System-python3,重启sumblie3即可
sumblie3 配置python脚本的文件头部信息
1.安装FileHeader
2.配置文件
Preferences->Packages Settings->File Header->Settings User{
"Author":"XXXXXXX",
"Email":"768688@qq.com"
br/>{
"Default":
{
"Author":"XXXXXXX",
"Email":"768688@qq.com"
}
}
3.FileHeader\template\header\Python.tmpl文件
-# -- coding: utf-8 --
import sys
reload(sys) python3中利用from imp import reload
sys.setdefaultencoding('utf-8') #python3取消了sys.setdefaultencoding()改函数
-# @Author: {{Author}}
-# @Date: {{create_time}}
-# @Last Modified by: {{last_modified_by}}
-# @Last Modified time: {{last_modified_time}}
4.解决print('中文')乱码问题
修改Python3.sublime.build文件,加入
"env": {"PYTHONIOENCODING": "utf8"}