Python json序列化 反序列化

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/CSU_GUO_LIANG/article/details/83153476
import json
# 序列化  反序列化
print(dir(json))
d1=dict(name='小米',age=2,score=99)
print(d1)
strs=json.dumps(d1)
print(strs)
d2=json.loads(strs)
print(d2)

猜你喜欢

转载自blog.csdn.net/CSU_GUO_LIANG/article/details/83153476