python UnicodeDecodeError: 'gbk' codec can't decode byte 0xff in position 0
diri='D:\\dat'os.chdir(diri)forfilesinos.listdir(diri):print(files)newf=os.path.join(...
diri = 'D:\\dat'
os.chdir(diri)
for files in os.listdir(diri):
print(files)
newf = os.path.join(diri,files)
f = open(newf,'r')
data = [line.strip() for line in f.readlines()]
后面提示说python UnicodeDecodeError: 'gbk' codec can't decode byte 0xff in position 0: illegal multibyte seque,错误就在于data赋值这一行,新手求教,对了python是用eclipse编写的 展开
os.chdir(diri)
for files in os.listdir(diri):
print(files)
newf = os.path.join(diri,files)
f = open(newf,'r')
data = [line.strip() for line in f.readlines()]
后面提示说python UnicodeDecodeError: 'gbk' codec can't decode byte 0xff in position 0: illegal multibyte seque,错误就在于data赋值这一行,新手求教,对了python是用eclipse编写的 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询