我需要创建一个自定义扩展名为“.stz”的zip存档,因为这是应用程序将在其中使用的唯一可接受的文件格式。使用shutil.make_存档,即使我没有指定扩展名,文件也始终具有.zip文件扩展名。目前正在创建后重命名它。有更好的方法吗
import os
import shutil
output = “file.stz”
dir_name = “files/“
zip_name = shutil.make_archive(‘tmp’, ‘zip’, dir_name)
os.rename(zip_name, output)
目前没有回答
相关问题 更多 >
编程相关推荐