import zipfile
z = zipfile.ZipFile('myzip.zip', 'w', zipfile.ZIP_DEFLATED)
z.write('file1.ext')
z.write('file2.ext')
z.printdir()
z.close()
z = zipfile.ZipFile('myzip.zip', 'a', zipfile.ZIP_DEFLATED)
z.write('file3.ext')
z.printdir()
z.close()
z = zipfile.ZipFile('myzip.zip', 'r', zipfile.ZIP_DEFLATED)
z.extractall('mydir')
z.close()
python how to append to file in zip archive