Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare
来源:互联网 发布:惯性参考系 知乎 编辑:程序博客网 时间:2024/05/16 07:21
Python中出现的错误
可按照错误建议网址查看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 :
四,有中文注释的情况下最好有
# coding=utf-8
阅读全文
1 0
- 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错误
- python出现Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare错误
- Non-ASCII character '\xe8' in file xxx.py on line 8, 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出现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出现中文错误:SyntaxError: Non-ASCII character '\xe7' in file car-training.py on line 7, but no encod
- SyntaxError: Non-ASCII character '\xef' in file deinstall_mysql_5.7.py on line 8, but no encoding de
- SyntaxError: Non-ASCII character '\xe8' in file model.py on line 300, but no encoding declared; 报错
- Non-ASCII character '\xb3' in file e:\python\ship.py on line 6, but no encoding declared;
- QUERY
- springmvc传递参数pojo
- Robot framework的安装探索
- NYOJ 前缀式计算(栈)
- WPF子弹头复选框(BulletCheckBox)
- Non-ASCII character '\xe7' in file ex6.py on line 1, but no encoding declare
- 分布式代码管理工具Git安装和使用(linux)
- 洛谷——乌龟棋题解
- java 图片合成
- Unity Shader入门教程(三)自制光照模型
- ConcurrentHashMap特性二
- TOMCAT原理详解及请求过程
- 实习第一个月体会和总结
- PM2