首页 > 数据库 >test redis

test redis

时间:2023-02-27 22:16:39浏览次数:38  
标签:test1 indexKey keys redis indexValue1 print test

 

import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
r.set('test1', 'test1')

value1 = r.get('car')
print(value1)

all_keys = r.keys()
print(all_keys)

for indexKey in all_keys:
    indexValue1 = r.get(indexKey)
    print(indexValue1)


if r.exists("test1"):
    r.delete("test1")


all_keys = r.keys()
print(all_keys)

for indexKey in all_keys:
    indexValue1 = r.get(indexKey)
    print(indexValue1)

 

 

#############

标签:test1,indexKey,keys,redis,indexValue1,print,test
From: https://www.cnblogs.com/herd/p/17162128.html

相关文章