You can download this code by clicking the button below.
This code is now available for download.
Create a zip file from a list of files.
Technology Stack : zipfile
Code Type : File operation
Code Difficulty : Intermediate
def zipfiles(file_list, output_zip):
import zipfile
with zipfile.ZipFile(output_zip, 'w') as zipf:
for file in file_list:
zipf.write(file)
return "Zip file created successfully."