Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import zlib
- def compress(src,out,complvl=9):
- with open(src, "rb") as in_file:
- compressed = zlib.compress(in_file.read(), complvl)
- with open(out, "wb") as out_file:
- out_file.write(compressed)
- def decompress(src,out):
- with open(src, "rb") as in_file:
- compressed = zlib.decompress(in_file.read())
- with open(out, "wb") as out_file:
- out_file.write(compressed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement