1.JSON (Javascript Object Notation) is a lightweight data interchange format. Easy for people to read and write. It is also easy for machine parsing and generation. It is based on JavaScript programming Language, Standard ECMA-262 a subset of 3rd Edition-december 1999. JSON takes a completely language-independent text format, but also uses a similar idiom to the C language family (c, C + +, C #, Java, JavaScript, Perl,python, etc.). These features make JSON an ideal data exchange language.
JSON is constructed in two structures: a combination of "name/value" pairs, which can be understood as objects (object), records (record), structures (structs), dictionaries (dictionary), hash tables (hash table), and keyed lists (keyed list) or an associative array (associative array). An ordered list of values: In most languages, is understood as an array (array). 2.python starts with JSON after 2.6 and can be
Import JSONImport the JSON module. The main object is serialization and deserialization. Encoding converts a Python object to a JSON string, and decoding converts the JSON format string to a Python object.
The JSON type corresponds to the Python primitive type as shown in the following table
Using the Json.dumps method, you can convert a Python object to a JSON object, and the Json.dumps method provides a number of useful parameters to choose from, compared with sort_keys (sorting Dict objects, we know that the default dict is unordered), Separators,indent and other parameters, the dumps method is defined as:
Dumps (obj, Skipkeys=false, Ensure_ascii=true, Check_circular=true,
Allow_nan=true, Cls=none, Indent=none, Separators=none,
Default=none, Sort_keys=false, **kw):
Json.load and Json.jump files need to be stored in JSON format for file reads and writes.
Json.loads and Json.jumps are operations on Python objects.
To be continued ************************************************* **************
Python module-json