Create Zip File with Specified File

  • Share this:

Code introduction


This function creates a zip file and adds the specified file to it.


Technology Stack : zipfile

Code Type : File processing

Code Difficulty : Intermediate


                
                    
def zipfile_create(arg1, arg2):
    with zipfile.ZipFile(arg1, 'w') as zipf:
        zipf.write(arg2)                
              
Tags: