码迷,mamicode.com
首页 > 其他好文 > 详细

Non-ASCII character '\xe8' in file xxx.py on line 8, but no encoding declared

时间:2015-08-17 23:47:04      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:python   character   编码   


        使用网上某个python程序,编译时报错:

        File "xxx.py", line 8         SyntaxError: Non-ASCII character ‘\xe8‘ in file xxx.py on line 8, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

        原因是缺少编码类型声明:no encoding declared

        段首添加一行声明即可:

        #encoding:utf-8

版权声明:本文为csdn博主[applebite](http://blog.csdn.net/applebite) 原创文章,转载请注明出处,侵权必究。

Non-ASCII character '\xe8' in file xxx.py on line 8, but no encoding declared

标签:python   character   编码   

原文地址:http://blog.csdn.net/applebite/article/details/47733233

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!