A python program fails to execute in sublime text 3, but success in bash [duplicate]

隐身守侯 提交于 2019-12-01 13:08:07

Sublime has a configuration problem. Python uses the default ascii codec when it can't determine the terminal encoding. It is figuring it out correctly in bash so it works.

If you set the environment variable set PYTHONIOENCODING=utf8 before launching sublime you can force Python to use that encoding when printing. I'm not familiar with sublime so I can't suggest how to fix its configuration.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!