解决SyntaxError: Non-ASCII character '\xe7' in file demo.py on line 15问题
2017-11-03 09:45
1276 查看
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无法显示中文的问题: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
- 解决File "temp.py", line 10 SyntaxError: Non-ASCII character '\xe5' in file temp.py on line 10, but no
- 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 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问题Non-ASCII character '\xe5' in file Apriori.py on line 1, but no encoding declared 解决办法
- Python: SyntaxError: Non-ASCII character '\xa3' in file main.py on line 3, but no encoding declared
- 【python问题系列--1】SyntaxError:Non-ASCII character '\xe5' in file kNN.py on line 2, but no encoding declared;
- python脚本执行报错:SyntaxError: Non-ASCII character '\xe6' in file ip.py on line 4...
- SyntaxError: Non-ASCII character '\xe5' in file a.py on line 9, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
- python错误:SyntaxError: Non-UTF-8 code starting with '\xcb' in file E:/Python/test.py on line 2
- python - 中文打印报错SyntaxError: Non-ASCII character '\xe4' in file test.py on line 3, but no encoding declared。
- SyntaxError: Non-ASCII character '\xe5' in file D:/pcode/xx.py on line 21, but no encoding declared
- SyntaxError: Non-UTF-8 code starting with '\xc5' in file t.py on line 3,but no encoding declared;see http://python.org/dev/peps/pep-0263/ for details