用sublime text 2 编译 python 遇到中文的问题

作者: aries 分类: Python 发布时间: 2012-10-27 13:58 ė 3393次浏览 6 0评论

当你用sublime text 2 编译 python的时候,如果输出中有中文,就会出现

[Decode error - output not utf-8]

找了找google,解决了

解决方案:

在插件的文件夹下找到python文件夹,进去、修改Python.sublime-build文件。我的操作系统为win7。

路径为:C:Users您的用户名AppDataRoamingSublime Text 2PackagesPython

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

就是加入了一句

"encoding": "cp936"
换一个
暂无评论
Ɣ回顶部