Non-ASCII character ‘\xe8’ in file xxx.py on line 8, but no encoding declared

when using a python program on the Internet, an error occurs when compiling:

File “xxx.py”, line 8 SyntaxError: Non-ASCII character ‘\xe8’ in file xxx.py on line 8, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

The reason is that the encoding type declaration is missing: no encoding declared

Add a line declaration at the beginning of the paragraph

# encoding:utf-8

Copyright notice: This is CSDN blogger [applebite]( http://blog.csdn.net/applebite )Original article, reprint please indicate the source, infringement must be investigated. WeChat adds official account number: qi_ Chuang or novelty hunting innovation platform

Similar Posts: