SyntaxError: Non-UTF-8 code starting with ‘\xc4‘ in file E:/7.python/day3/easyguis.py on line 2

关于python使用easygui出现

SyntaxError: Non-UTF-8 code starting with '\xc1' in file C:\...\xxx.py on line 8, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

解决方法:在最上面加上#coding: utf-8 即可运行。代码如下:

#coding: utf-8
import easygui
easygui.msgbox('你好世界')

SyntaxError: Non-UTF-8 code starting with ‘\xc4‘ in file E:/7.python/day3/easyguis.py on line 2

上一篇:一次通过docker编译openresty报错curl returned a non-zero code: 6无法通过的问题处理


下一篇:Effective C++条款36:继承与面向对象——绝不重新定义继承而来的non-virtual函数