I need to create a zip archive with a custom extension of ‘.stz’ as this is the only file format accepted by the application it will be used in. Using shutil.make_archive the file always has the .zip file extension even if not specified by me. Currently just renaming it after creation. Is there a better way to do this?
import os
import shutil
output = “file.stz”
dir_name = “files/“
zip_name = shutil.make_archive(‘tmp’, ‘zip’, dir_name)
os.rename(zip_name, output)