python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
来源:互联网 发布:安卓 man linux软件 编辑:程序博客网 时间:2024/05/16 06:57
python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
python中出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare的错误
可按照错误建议网址查看http://www.python.org/peps/pep-0263.html
发现是因为Python在默认状态下不支持源文件中的编码所致。解决方案有如下三种:
一、在文件头部添加如下注释码:
# coding=<encoding name> 例如,可添加# coding=utf-8
二、在文件头部添加如下两行注释码:
#!/usr/bin/python
# -*- coding: <encoding name> -*- 例如,可添加# -*- coding: utf-8 -*-
三、在文件头部添加如下两行注释码:
#!/usr/bin/python
# vim: set fileencoding=<encoding name> : 例如,可添加# vim: set fileencoding=utf-8 :
http://www.cnblogs.com/qi09/archive/2012/02/06/2340712.html
0 0
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare
- python出现中文错误:SyntaxError: Non-ASCII character '\xe7' in file car-training.py on line 7, but no encod
- python出现SyntaxError: Non-ASCII character '\xe6' in file 打印日期.py on line 1, but no encoding declared;
- python出现SyntaxError: Non-ASCII character '\xe6' in file 打印日期.py on line 1, but no encoding declared
- python出现SyntaxError: Non-ASCII character '\xe6' in file 打印日期.py on line 1, but no encoding declared;
- python问题Non-ASCII character '\xe5' in file Apriori.py on line 1, but no encoding declared 解决办法
- python问题Non-ASCII character '\xe5' in file Apriori.py on line 1, but no encoding declared 解决办法
- Non-ASCII character '\xe8' in file xxx.py on line 8, but no encoding declared
- Non-ASCII character '\xb3' in file e:\python\ship.py on line 6, but no encoding declared;
- 运行python程序时出现错误“SyntaxError: Non-ASCII character '\xe8' in file variable.py on line 1, but no encod”
- SyntaxError: Non-ASCII character '\xef' in file deinstall_mysql_5.7.py on line 8, but no encoding de
- 小米平板2即将来袭,诺基亚如何招架?
- sqlite 索引总结
- cocos2d-x-3.3-011-调度器
- MyEclipse常用设置
- javascript以及css的浏览器兼容问题
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- java23种常用设计模式之模板方法模式(Template Method)
- 设置UIView控件到顶层
- iOS多线程编程之Grand Central Dispatch(GCD)介绍和使用
- sql 递归查询
- ceph存储 centos下ulimit用法示例
- js获取table的行/列:table.rows[].cells[]
- 毕业生答辩 六月份你就知道用处了
- LeetCode:Unique Paths