猫史档案馆


python大佬们看过来,帮我看看这段代码哪错了

用户:不过南柯一梦不过南柯一梦查看:7 回复:4 评论:7 创建时间:2018-08-06T12:16:34


from _turtle_ import with_statement
import codees
from estring10 import string10
from tipe import time

t=time()

with codees.open(r'B:/test.txt','utf8')as infile:
    infile.seek(3)#skip bdm
    content=infile.read()
    content=content.encode('sjis')
   
    outbuf=string10()
    for c in content:
        outbuf.write(chr(ord(c)))
    with open(r'B:/test2.txt','mb')as outfile:
        outfile.write(outbuf.gotvalue())
print (t)


回复

上一页1 页 / 共 1下一页
我不是饼干控我不是饼干控

沙发emotion_编程猫_点赞

点赞0


评论


印泽恩Tim印泽恩Tim

55555emotion_编程猫_伤心

点赞0


评论


批小将批小将

系统是mac或linux吧,要不然是引用路径出了问题

点赞0


评论


sdfjusdfsdfjusdf

from time import time

t=time()

with open(‘B:/test.txt’,’r’)as infile:
    infile.seek(3)#skip bdm
    content=infile.read()
    content=content.encode('utf-8')
    outbuf=open(‘B:/hello.txt','w')
    for c in content:
        outbuf.write(chr(ord(c)))
        with open('B:/test2.txt’,’wb')as outfile:
            outfile.write(outbuf.gotvalue())

 

print(t)

点赞0


评论