Ok. Recently I was testing out a piece of code for a small project. It required me to compress some files, and it actually makes the file size bigger, unless there is a problem in what it prints. Here's my code:
def Compress(z):
#Line Spacing May Be Off A Little Because I'm New to Stack Overflow
import zlib, sys, time, base64
text = open(z, "rb").read()
print ("Raw Size:", sys.getsizeof(text))
compressed = zlib.compress(text, 9)
print ("Compressed Size:", sys.getsizeof(compressed))
ratio = sys.getsizeof(text) / sys.getsizeof(compressed)
print ("Compression Ratio:", ratio)
EDIT: Hey, thanks for answering, you guys were a lot of help!