You can download this code by clicking the button below.
This code is now available for download.
This function compresses two files into a single zip file.
Technology Stack : zipfile
Code Type : File compression
Code Difficulty : Intermediate
def zip_file(file1, file2, output):
import zipfile
with zipfile.ZipFile(output, 'w') as z:
z.write(file1, arcname=file1)
z.write(file2, arcname=file2)