想请教一下这个问题应该如何修改才能让它运行出来?请教各位,谢谢!
文件中带中文,都是编码的问题,加encoding
open('test.txt', 'r',encoding='utf-8')
with open 的括号里面加一个参数 encoding=“utf-8”