擅长:python、mysql、java
<p>您可以通过<code>hmset</code>(可以使用<code>hmset</code>设置多个键)。</p>
<p><code>hmset("RedisKey", dictionaryToSet)</code></p>
<pre><code>import redis
conn = 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'}
</code></pre>