首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >TypeError:强制转换为Unicode:需要字符串或缓冲区

TypeError:强制转换为Unicode:需要字符串或缓冲区
EN

Stack Overflow用户
提问于 2011-07-13 21:55:32
回答 4查看 161.2K关注 0票数 62

此代码返回以下错误消息:

  • 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')

请谁来帮帮我。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6680066

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档