已配置了sublime text3 使用anaconda Python3 的build system
{
"cmd": ["python", "-u", "$file"],
"path":"/Users/areana/software/anaconda3/bin",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "[source.python]",
}
在网上查找了一些资料,用
import sys
print(sys.stdout.encoding)
打印了当前的编码,
输出结果 'US-ASCII'
确实是输出设置的问题,默认英文状态采用 ASCII
肯定无法显示中文。
根据网上的修改方法,在配置中加入
"env": {"LANG": "en_US.UTF-8"}
{
"cmd": ["python", "-u", "$file"],
"path":"/Users/areana/software/anaconda3/bin",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "[source.python]",
"env": {"LANG": "en_US.UTF-8"}
}
修改后配置如上,重启sublime后中文输出正常了。
参考链接:https://blog.csdn.net/u011286584/article/details/55259897