一句话的事:没添加encoding='utf-8’之前,会报错。
报错的信息如下所示: ‘gbk’ codec can’t decode byte 0xaa in position 8: illegal multibyte sequence
于是我又在open()中补上了encoding = ‘utf-8’
with open('四个春天.txt','r',encoding='utf-8') as f:
就解决问题了
一句话的事:没添加encoding='utf-8’之前,会报错。
报错的信息如下所示: ‘gbk’ codec can’t decode byte 0xaa in position 8: illegal multibyte sequence
于是我又在open()中补上了encoding = ‘utf-8’
with open('四个春天.txt','r',encoding='utf-8') as f:
就解决问题了