当我尝试运行此python-2.7程序时,它可以正常工作而没有任何错误,但是问题是它不会转换和写入整个文件(仅转换98959行),而原始文件包含99157行
为什么会这样呢?
import base64
input_file = open("answer.txt","r")
output_file = open("result.txt","w")
for eachline in input_file.readlines():
output_file.write(base64.b64decode(eachline))
原始文件链接:https : //drive.google.com/open?id=0B_566weiakkYLVBhSHJndkFMX3M&authuser=0
如果有人可以帮助我提前谢谢
您尚未关闭文件
output_file.close()
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句