3
import redis

config=redis.Redis(host='localhost')
dic={'name':'tom','age':20,'subjects':['eng','cn']}
config.hmset('person',dic)

print(config.hgetall('person')) 

を取得し{b'age': b'20', b'name': b'tom', b'subjects': b"['eng', 'cn']"}ます。dicしかし、私はオブジェクトを取り戻したいです。すなわち:{'name':'tom','age':20,'subjects':['eng','cn']}、どのように?

4

1 に答える 1