text = {"name":"Jack","age":29}
read_json = json.loads(text) # 把字典转换为json
print(read_json)
print(type(read_json))
result = json.dumps(read_json) # 把字典转为str
print(result )
print(type(result ))
结果
{'name': 'Jack', 'age': 29}
<class 'dict'>
{"name": "Jack", "age": 29}
<class 'str'>