在文件头部添加这一句即可# -*- 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 -*-
时间: 2024-10-31 01:39:09