标签:get port password word style 根据 import pass ons
思路:
1、获取a redis里面所有的key
2、判断key的类型:sting、hash
3、然后根据key的类型set或hset到b redis里
1 import redis 2 r = redis.Redis(host = ‘127.0.0.0‘,password=‘HK139bc&*‘,port=6379,db=0,decode_responses=True) 3 r1 = redis.Redis(host = ‘127.0.0.1‘,password=‘HK139bc&*‘,port=6379,db=0,decode_responses=True) 4 for k in r.keys(): 5 if r.type(k) == ‘string‘: 6 value = r.get(k) 7 r1.set(k,value) 8 if r.type(k) == ‘hash‘: 9 value = r.hgetall(k) 10 r1.hmset(k,value)
标签:get port password word style 根据 import pass ons
原文地址:https://www.cnblogs.com/xumb/p/11885997.html