Python,Non-ASCII character '\xef'错误

code git:(master) ✗ python wx.py
File “wx.py”, line 1
SyntaxError: Non-ASCII character ‘\xef’ in file wx.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

python2 不支持这种写法
#-*- coding:utf-8 -*-

需要改为
#coding=utf-8

猜你喜欢

转载自blog.csdn.net/bacteriumx/article/details/80753686