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

aries 发表于 2012-10-27 3543 次浏览

当你用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"

0条评论

如需评论,请填写表单。
换一个

记住我的信息