设为首页 加入收藏

TOP

【python】"no encoding declared"error in python
2019-01-11 14:57:09 】 浏览:27
Tags:python " encoding declared" error
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_30214939/article/details/58097843
1.error:
SyntaxError: Non-ASCII character '\xe7' in file ./class.py on line 9, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

2.proposed Solution:

I propose to make the Python source code encoding both visible andchangeable on a per-source file basis by using a special commentat the top of the file to declare the encoding.

To make Python aware of this encoding declaration a number ofconcept changes are necessary with respect to the handling ofPython source code data.


3.method:

#coding=utf-8 


>

or:

# -*- coding:utf-8 -*-

4.for more details:

see python官网指导:link


编程开发网
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇cmd中执行Python命令时>>&g.. 下一篇.[Python 技术培训] 第一周幻灯片..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

array(4) { ["type"]=> int(8) ["message"]=> string(24) "Undefined variable: jobs" ["file"]=> string(32) "/mnt/wp/cppentry/do/bencandy.php" ["line"]=> int(217) }