python 与 json
+-------------------+---------------+
| Python | JSON |
+===================+===============+
| dict | object |
+-------------------+---------------+
| list, tuple | array |
+-------------------+---------------+
| str | string |
+-------------------+---------------+
| int, float | number |
+-------------------+---------------+
| True | true |
+-------------------+---------------+
| False | false |
+-------------------+---------------+
| None | null |
+-------------------+---------------+
dumps 和 dump:
dumps和dump 序列化方法
dumps只完成了序列化为str,
dump必须传文件描述符,将序列化的str保存到文件中
loads和load 反序列化方法
loads 只完成了反序列化,
load 只接收文件描述符,完成了读取文件和反序列化