You can download this code by clicking the button below.
This code is now available for download.
This function zips two files into a single zip file. It returns True if the output file exists, otherwise it returns False.
Technology Stack : os, zipfile
Code Type : File processing
Code Difficulty : Intermediate
def zip_file(file1, file2, output):
import os
import zipfile
with zipfile.ZipFile(output, 'w') as z:
z.write(file1)
z.write(file2)
return os.path.exists(output)