python 运行时报错误SyntaxError: Non-ASCII character '\xe5' in file 1.py on line 2
2015-07-13 15:57
836 查看
File "1.py", line 2
SyntaxError: Non-ASCII character '\xe5' in file 1.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
原因是:Python默认是以ASCII作为编码方式的,需要在文件开头设置一下编码
SyntaxError: Non-ASCII character '\xe5' in file 1.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
原因是:Python默认是以ASCII作为编码方式的,需要在文件开头设置一下编码
# -*- coding: UTF-8 -*- 或者 #coding=utf-8
相关文章推荐
- python3.4学习笔记(二十二) python 在字符串里面插入指定分割符,将list中的字符转为数字
- python第三方库系列之十九--python测试使用的mock库
- python基础教程总结1——列表和元组
- python 目录文件操作 os模块
- python正则相关
- Python学习笔记——一些常用函数、常见错误总结
- python 模块==命名空间?
- python 打开一个文件并随机读取文件某一行
- Multiprocessing vs Threading Python
- python 之 模拟GET/POST提交
- Python Paste.deploy 笔记
- Python thread pool similar to the multiprocessing Pool?
- python 随机数
- python 计算器
- Python.Paste指南之Deploy
- python 读取文件
- python 函数参数
- Python3.2官方文件翻译-工具列表和十进制浮点计算
- python第一个爬虫
- python第三方库系列之十八--python/django test库