解决SyntaxError: Non-ASCII character '\xe7' in file demo.py on line 15问题
2016-09-20 16:02
1231 查看
File "demo.py", line 14
SyntaxError: Non-ASCII character '\xe7' in file demo.py on line 15, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
出现这种错的解决办法:
在文件头上加上:
# -*- coding: cp936 -*-
或者
# -*- coding: utf-8 -*
SyntaxError: Non-ASCII character '\xe7' in file demo.py on line 15, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
出现这种错的解决办法:
在文件头上加上:
# -*- coding: cp936 -*-
或者
# -*- coding: utf-8 -*
相关文章推荐
- 解决SyntaxError: Non-ASCII character '\xe7' in file demo.py on line 15问题
- [已解决]关于python无法显示中文的问题:SyntaxError: Non-ASCII character '\xe4' in file test.py on line 3, but no enc
- 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 解决办法
- 关于python无法显示中文的问题:SyntaxError: Non-ASCII character '\xe4' in file test.py on line 3, but no encoding
- [已解决]关于python无法显示中文的问题:SyntaxError: Non-ASCII character '\xe4' in file test.py on line 3, 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 '\xe4' in file test.py on line 3
- 关于python无法显示中文的问题:SyntaxError: Non-ASCII character '\xe4' in file test.py on line 3, but no encoding
- python出现中文错误:SyntaxError: Non-ASCII character '\xe7' in file car-training.py on line 7, but no encod
- 关于python无法显示中文的问题:SyntaxError: Non-ASCII character '\xe4' in file test.py on line 3, but no encoding
- 解决File "temp.py", line 10 SyntaxError: Non-ASCII character '\xe5' in file temp.py on line 10, but no
- 【python问题系列--1】SyntaxError:Non-ASCII character '\xe5' in file kNN.py on line 2, but no encoding declared;
- Python: SyntaxError: Non-ASCII character '\xa3' in file main.py on line 3, but no encoding declared
- SyntaxError: Non-ASCII character '***' in file *** on line **,but no encoding declared;
- python脚本执行报错:SyntaxError: Non-ASCII character '\xe6' in file ip.py on line 4...
- python错误解决:SyntaxError: Non-ASCII character '\xd3' in file crawler.py
- SyntaxError: Non-ASCII character '\xe5' in file index.py on line 6, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
- python错误:SyntaxError: Non-UTF-8 code starting with '\xcb' in file E:/Python/test.py on line 2
- SyntaxError: Non-ASCII character '\xe5' in file D:/pcode/xx.py on line 21, but no encoding declared