Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. file.zip
  2. - first folder
  3. - file1.pdf
  4. - file2.pdf
  5. - second folder
  6. - file3.pdf
  7.  
  8. zip_file = ZipFile(zip_file_path)
  9.  
  10. zip_byte_array = bytearray()
  11. for filename in zip_file.namelist():
  12. byte_content = zip_file.read(filename)
  13. zip_byte_array.append(byte_content)
  14.  
  15. an integer is required
  16.  
  17. zip_file_path = shutil.make_archive(dir_path, 'zip', dir_path)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement