使用Sublime3运行Python3无法输出台无法打印UTF-8问题

报错:

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)


解决方法

1.找到在 sublime3 中运行 python3 使用的 build system

2.在最后加上一条:

"env": {"PYTHONIOENCODING": "utf8"}

总的配置是这样:

{

"cmd": ["/usr/local/bin/python3", "-u", "$file"],

"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",

"selector": "source.python",

"env": {"PYTHONIOENCODING": "utf8"}

}


问题就解决了!!

你可能感兴趣的:(使用Sublime3运行Python3无法输出台无法打印UTF-8问题)