Sublime3的python代码⾃动提⽰
配置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:/"
3.配置⾃定义的anaconda
Preference--Package Setttings--Anaconda--Settings User
{
"python_interpreter": "E:/",
"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:/","-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"
python新手代码useridbr/>{
"Default":
{
"Author":"XXXXXXX",
"Email":"768688@qq"
}
}
3.FileHeader\template\pl⽂件
-# -- 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"}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论