word_cloud_bot/test/redishset.py
机器人总动员 14e8e7f627 init
2021-05-05 10:59:30 +08:00

11 lines
291 B
Python

import redis
pool = redis.ConnectionPool(host='127.0.0.1', port=6379, encoding='utf8', decode_responses=True, db=0)
r = redis.StrictRedis(connection_pool=pool)
# r.hset("user", "a", 1)
# r.hincrby('user', "a")
# r.hincrby('user', "b")
print(r.hget("user", "a"))
print(r.hget("user", "b"))