You can download this code by clicking the button below.
This code is now available for download.
This function takes a list of files and an output zip file path, and zips all files into a single zip file.
Technology Stack : zipfile
Code Type : File compression
Code Difficulty : Intermediate
def zipfiles(file_list, output_zip_path):
with zipfile.ZipFile(output_zip_path, 'w') as zipf:
for file in file_list:
zipf.write(file, arcname=file)
return "Files have been zipped successfully."