redis保存数组
作者:互联网
import redis host = 'xxxxx' port = 6379 db_data = 10 redis_data= redis.Redis(host=host, port=port,db=db_data, password=password,decode_responses=True) callernumber=“18812345678” speaker="home" message="早啊" obj={"speaker":speaker,"message":message} obj = json.dumps(obj) redis_data.rpush(callernumber, obj) # 缓存记录对话信息
标签:obj,redis,保存,speaker,数组,message,data,port 来源: https://www.cnblogs.com/huangqihui/p/15210556.html