我正在尝试创建一个临时目录的存档,并在完成后将该存档放在临时目录中。这样,我可以在我的web应用程序中的请求完成后删除整个目录。你知道吗
现在,当这个过程完成时,归档文件中还包含OutputArchive.zip
文件。如何将OutputArchive.zip
写入temp_dir
而不压缩自身?你知道吗
代码
# zip all contents of this
temp_dir = r'E:\webapps\geodata-dev\data\tmpws55et'
# place the OutputArchive.zip in the above directory without zipping itself
shutil.make_archive(os.path.join(temp_dir, 'OutputArchive'), 'zip', temp_dir)
目前没有回答
相关问题 更多 >
编程相关推荐