#How to compress or compact a string in Python
Explore tagged Tumblr posts
Text
How to compress or compact a string in Python
import sys import zlib text=bThis function is the primary interface to this module along with decompress() function. This function returns byte object by compressing the data given to it as parameter. The function has another parameter called level which controls the extent of compression. It an integer between 0 to 9. Lowest value 0 stands for no compression and 9 stands for best compression. Higher the level of compression, greater the length of compressed byte object.
0 notes