三、写入JSON文件
JSON全称为JavaScript Object Notation
JSON官方网站:http://json.org/
1.JSON与Python
JSON | Python |
---|---|
object | dict |
array | list |
string | str |
number (int / real) | int / flfloat |
true / false | True / False |
null | None |
2.Python与JSON
Python | JSON |
---|---|
dict | object |
list, tuple | array |
str | string |
int, flfloat, int- & flfloat-derived Enums | number |
True / False | true / false |
None | null |
例子:<