Json库
# Json库
# 序列化和反序列化
反序列化,不带s是文件流用的
loads
Deserialize
s
(astr
,bytes
orbytearray
instance containing a JSON document) to a Python object.
load
Deserialize
fp
(a.read()
-supporting file-like object containing a JSON document) to a Python object.
序列化,不带s是文件流用的
dumps
Serialize
obj
to a JSON formattedstr
.
dump
Serialize
obj
as a JSON formatted stream tofp
(a.write()
-supporting file-like object).