网站首页 Python Python - Sublime Text 3 控制台不能输出中文的解决方法
Python - Sublime Text 3 控制台不能输出中文的解决方法
编辑时间:2018-12-08 22:28:40 作者:admin 浏览量:659

1.pngWindows系统

Tools -> Build System -> New Build System

{  

    "cmd": ["python","-u","$file"],  

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

    "selector": "source.python",  

    "encoding": "cp936" 

}

 

用上面的代码替换掉"shell_cmd": "make", 保存当前配置文件为: "python3.sublime-build", 然后在Tools -> Build System->选择 "python3"


Mac系统

1. Tools -> Build System -> New Build System

2. 取名 Python3.sublime-build

3. 编辑 Python3.sublime-build,输入:

{

    "cmd": ["/Library/Frameworks/Python.framework/Versions/3.6/bin/python3","-u","$file"],

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

    "selector": "source.python",

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

}

4. 保存重启sublime,选择Tools -> Build System ->Python3



    上一篇:Pycharm 安装 autopep8 工具
    下一篇:Mac安装Pygame遇到的坑
    出自:洪庆柳

    地址:www.xmaniu.com

    转载请注明出处!