Commit 7d671bed by qlintonger xeno

Delete redis-op.py

parent 5924414a
import redis
# 连接到 Redis 服务器
r = redis.Redis(host='localhost', port=6379, db=0)
# 哈希表的键名
hash_key = 'onlineUsers'
# 使用 hgetall 方法获取哈希表的所有字段和值
result = r.hgetall(hash_key)
# 遍历结果
for field, value in result.items():
print(f"Field: {field.decode('utf-8')}, Value: {value.decode('utf-8')}")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment