在脚本上读取一个文本文件但是报错了,源代码如下
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');

在脚本上读取一个文本文件但是报错了,源代码如下
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');