设为首页 加入收藏

TOP

【python】"no encoding declared"error in python
2018-12-16 18:58:08 】 浏览:43
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

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇hand first python 选读(2) 下一篇python manag.py syncdb不能成功..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目