SyntaxError- Non-ASCII character '-xe8' in file

来源:互联网 发布:java依赖注入 编辑:程序博客网 时间:2024/06/04 19:39

python编译报错:
SyntaxError: Non-ASCII character ‘\xe8’ in file xxx原因是不支持中文注释,如这种中英文混杂注释:

 # Subtract off the mean and divide by the variance of the pixels. #减去平均值并除以像素的方差

解决办法:
在文件第一行加上

#encoding:utf-8
0 0
原创粉丝点击