If you need to create a zip of a directory using Python, then you can do the following:

Create a Zip using shutil in Python

1
2
3
4
5
6
7
8
import os
import shutil

filename = "compressed_archive"
format = "zip"
directory = os.getcwd()

shutil.make_archive(filename, format, directory)