现在的位置: 首页 > 综合 > 正文

【python】读写base64文件

2013年10月16日 ⁄ 综合 ⁄ 共 221字 ⁄ 字号 评论关闭
import base64
 
filea = open(r'c:\1.txt','r')   
lines = filea.readlines()
writefile=open(r'c:\2.txt','w')
for i in lines:   
        word = i.strip()
        b = base64.decodestring(word)
        print b
        writefile.write(b)
        writefile.write('\n')
writefile.close()
filea.close()

抱歉!评论已关闭.