Compress Files into a Zip Archive

  • Share this:

Code introduction


Compresses a list of files into a single zip file.


Technology Stack : zipfile

Code Type : File processing

Code Difficulty : Intermediate


                
                    
def zip_file(arg1, arg2):
    with zipfile.ZipFile(arg1, 'w') as zipf:
        for file in arg2:
            zipf.write(file)                
              
Tags: