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