主页
Python
Python json 模块
demo_ref_module_json_basic
运行 ❯
×
更改方向
保存代码
更改主题
import json data = {"name": "Emil", "age": 30} s = json.dumps(data, sort_keys=True) print(s) print(json.loads(s)["name"])
{"age": 30, "name": "Emil"}
Emil