更新时间:2023-11-29 19:20:46
如何将文件读取为二进制文件并将其转储?需要处理已有文件的情况.
How about reading file as binary and dump it? Need to deal cases where there is pre-existing file.
for name in zfile.namelist():
fname = os.path.join(zipdir, os.path.basename(name))
fout = open(fname, 'wb')
fout.write(zfile.read(name))