[Redis]存放字典
存放字典
import json
from redis import Redis
rdb = Redis()
d = {"key": "value"}
rdb.set("Leo2021", json.dumps(d))
print(json.loads(rdb.get("Leo2021")))
import json
from redis import Redis
rdb = Redis()
d = {"key": "value"}
rdb.set("Leo2021", json.dumps(d))
print(json.loads(rdb.get("Leo2021")))