JSON Javascript Object Notation
易于阅读,解析,传输效率高
适合做跨语言交换数据
JSON 对象,JSON,JSON字符串
JSON:是一种轻量级数据交换格式
是一种数据格式
JSON字符串:符合JSON格式的字符串叫做JSON字符串
JSON对象:如果跳出语言层面, 不存在json对象的概念
json_str = ‘{“name”:“sdf”,“age”:15}’
student = json.loads(json_str) #反序列化
json_str1 = json.dumbs(student) #序列化
json和python中数据类型对应表
json | python |
---|---|
object | dict |
array | list |
string | str |
number | int |
number | float |
true | True |
false | False |
null | None |