sublime text 2编译Python时打印中文报错的解决方案

前端之家收集整理的这篇文章主要介绍了sublime text 2编译Python时打印中文报错的解决方案前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

当用sublime text 2 编译 python 文件时,若 print 打印出的中文时,控制台会报错:

[Decode error - output not utf⑻]

解决方以下:

打开 sublime text 2 首选项 -> 阅读插件,进入 Python 文件夹,并找到 Python.sublime-build 文件

打开以下:

{ "cmd": ["python","-u","$file"],"file_regex": "^[ ]*File "(...*?)",line ([0⑼]*)","selector": "source.python" }

将其修改成:

{ "cmd": ["python","selector": "source.python","encoding": "cp936" }

便可解决该问题。

猜你在找的PHP相关文章