SaraGrella (0)

how can i zip a file and download it in a .py version?

You are viewing a single comment. View All
a5rocks (519)


import zlib

with open('file.txt', 'rb') as f:
  a = zlib.compress(, level=9)

with open('', 'wb') as f


If you want to make specific files a zip file. Please keep in mind I'm only putting this here so it's a more complete answer.