解决这个报错SyntaxError: Non-ASCII character
添加这个更简洁 #coding: utf-8
在文件头部添加这一句即可# -*- coding: utf-8 -*
SyntaxError: Non-ASCII character '\xe5' in file ex16.py on line 1,
ng declared; see http://python.org/dev/peps/pep-0263/ for details
意思是在文件中存在非ASCII字符(中文);
在头部添加
# -*- coding: utf-8 -*-
或
# -*- coding: cp936 -*-