SyntaxError: Non-ASCII character 'xe7' in file XXX on line 13, but no encoding declared;

mac2022-06-30  31

SyntaxError: Non-ASCII character '\xe7' in file /Volumes/NO NAME/work/djangorestful_hui-master/tutorial/TestDemo.py on line 13, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Process finished with exit code 1

错误原因  :   是 xxx.py文件里有中文字符   

改正方法   :文件的第一行  加上    

# coding=utf-8

最新回复(0)