python redis

  import redis

pool = redis.ConnectionPool(host='127.0.0.1', port=6379,db=1)
red = redis.Redis(connection_pool=pool)
di=['123','456']
red.set('name', str(di))
# red.delete("name")
# red.append("name","shijie")
red.set('key2', 2)
print(red.mget("name","key2"))

评论

刷新

友情链接