读string,list,set,sort_set,hash类型的数据 import redis class DataBase: def __init__(self, host, port): self.host = host self.port = port def read_string(self, key): try: r = redis.StrictRedis(host=self.host, port=self.port) result = r.get(key) return resul…