python通过zlib压缩和解压缩字符串,可以自定义压缩级别,级别越高压缩的约厉害,效率要低一些
import zlib compressedString = zlib.compress(originalString, 9) # 采用9级压缩 decompressedString = zlib.decompress(compressedString)
python通过zlib压缩和解压缩字符串,可以自定义压缩级别,级别越高压缩的约厉害,效率要低一些
import zlib compressedString = zlib.compress(originalString, 9) # 采用9级压缩 decompressedString = zlib.decompress(compressedString)