欢迎使用6miu-markdown编辑器

xiaoxiao2021-02-27  287

关于python的一些编码问题

'gbk' codec can't decode byte 0xbf in position 2: illegal multibyte sequence 文件本身处理过,我删除了其中的中文部分,只留下英文,仅仅是我认为的 解决问题来自于:http://blog.csdn.net/shijing_0214/article/details/51971734?locationNum=4&fps=1理解: 文件包含了超越本身编码的字符,需要更大的编码表示 -解决方法 txt = open(“E:\Administrator\Documents\作业\Hamlet.txt”,’r’,encoding=’utf8’).read()
转载请注明原文地址: https://www.6miu.com/read-7168.html

最新回复(0)