‘gbk‘ codec can‘t decode byte 0x80 in position 2: illegal multibyte sequence
在脚本上读取一个文本文件但是报错了,源代码如下threekingdomsFile=open('C:\\Users\\53469\\Desktop\\xfs\\python\\threekingdoms.txt','r');后来发现这是因为编码格式的原因,改成如下形式就可以了:threekingdomsFile=open('C:\\Users\\53469\\Desktop\\xfs\\python
·
在脚本上读取一个文本文件但是报错了,源代码如下
threekingdomsFile=open('C:\\Users\\53469\\Desktop\\xfs\\python\\threekingdoms.txt','r');
后来发现这是因为编码格式的原因,改成如下形式就可以了:
threekingdomsFile=open('C:\\Users\\53469\\Desktop\\xfs\\python\\threekingdoms.txt','r',100,'utf-8');
更多推荐
已为社区贡献6条内容
所有评论(0)