'gbk' codec can't encode character '\U0001f631' in position 56376: illegal m的解决办法

引自:https://www.cnblogs.com/themost/p/6603409.html


  在windows下面新文件的默认编码是gbk,所以想要向新文件里写数据需要改变新文件的编码:

  with open('rsp.html', 'w', encoding='utf-8') as f:



猜你喜欢

转载自blog.csdn.net/qq_38765321/article/details/80982357
今日推荐