JSON本质上是一个带有特定格式的字符串
主要功能是一种在各个编程语言中流通的数据格式,负责不同编程语言中的数据传递和交互。
json主要功能是语言之间的中转站。
python和json格式可以无缝切换
import json
data = [{"name": "guo1", "age": 26},{"name": "guo2", "age": 27}]
json_str = json.dumps(data, ensure_ascii=False)
print(type(json_str))
print(json_str)