[825]python lzstring

安装

pip install lzstring
import lzstring
 
ic = {"name": "root", "password": "123456"}
 
x = lzstring.LZString()
compressed = x.compressToBase64(str(ic))
print(compressed)
decompressed = x.decompressFromBase64(compressed)
print(decompressed)

打印内容

N4cgdghgtgpiBcACEAnA9mgLiANMgDhAM5EDuaKAJgsgIwBMAzACwCsAbCAL5A==
{'name': 'root', 'password': '123456'}

你可能感兴趣的:(python前行者)