python中出现utf-8编码格式错误

在写python的时候有好多次都出现了编码格式错误,就是下面这个

14569031-b8680f37c868783f.PNG
utf-8错误.PNG

在网上找了多篇文章看了看后发现在文件的第一行加上

“ #* coding:gb2312_*_ ”

14569031-31068ca460e599be.PNG
加上的.PNG

这就可以运行了

14569031-d449a3d2f130e9ea.PNG
utf-8改正.PNG

转载于:https://www.jianshu.com/p/b5863478c92e

猜你喜欢

转载自blog.csdn.net/weixin_34240520/article/details/91116092