Python3 sublime3 中文 UnicodeEncodeError 问题

preferences-browse package-user-找到build配置文件比如Python3.sublime-build。修改配置文件为:

{
"cmd":["python.exe", "-u", "$file"],
"path":"C:/Users/AppData/Local/Programs/Python/Python37",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env":{"PYTHONIOENCODING":"utf-8"},
"encoding": "utf-8",
}
import sys


print(sys.getdefaultencoding()) # utf-8
print(sys.stdin.encoding) # utf-8
print(sys.stderr.encoding) # utf-8
print(sys.stdout.encoding) # utf-8

 

你可能感兴趣的:(python)