您可以通过
hmset(使用来设置多个键
hmset)来做到这一点。
hmset("RedisKey", dictionaryToSet)import redisconn = redis.Redis('localhost')user = {"Name":"Pradeep", "Company":"SCTL", "Address":"Mumbai", "Location":"RCP"}conn.hmset("pythonDict", user)conn.hgetall("pythonDict"){'Company': 'SCTL', 'Address': 'Mumbai', 'Location': 'RCP', 'Name': 'Pradeep'}


