SyntaxError: Non-ASCII character ‘\xe6‘ in file test1.py on line 1, but no encoding declared; see ht

Python在默认状态下不支持源文件中的编码所致。解决方案如下:

在文件头部添加如下注释码:

coding= 例如,可添加# coding=utf-8

猜你喜欢

转载自blog.csdn.net/better_boy/article/details/107084071
今日推荐