将with open(file) as f: 改成 with open(file, ‘r’, encoding=‘utf-8’) as f:
就可以了。
关于UnicodeDecodeError: 'gbk' codec can't decode byte的解决办法
最新推荐文章于 2024-05-09 21:49:30 发布
将with open(file) as f: 改成 with open(file, ‘r’, encoding=‘utf-8’) as f:
就可以了。