with open (infile,mode='r',buffering=-1) as in_f,open (outfile,mode='w',buffering=-1) as out_f: TypeError:强制转换为Unicode:需要字符串或缓冲区,file found打开每个文件以读取/修改infile=open('110331_HS1A_1_rtTA.result','r') outfile=open('2.txt','w') with open (infile,mode='r',buffering=-1) as in_f,open (outfile,mode=‘r’,buffering=-1)as in_f,open(outfile,mode='w',缓冲=-1) as out_f: f=(如果i.rstrip(),in_f中的i为i),对于f:_中的行,k= line.split('\t',1) x=bufferingk)如果不是x:继续out_f.write(‘'.join(x) + '\n')