Concept
serialization (serialization): Converts the state information of an object into a process that can be stored or transmitted over a network, in the form of JSON, XML, and so on. Deserialization is the state of the deserialized object that is read from the storage area (Json,xml) and re-created.
JSON (JavaScript Object Notation): A lightweight data interchange format that is easier to read and write than XML, is easy to parse and generate, and JSON is a subset of JavaScript.
Python2.6 started adding JSON modules without additional download, and the Python JSON module serialization and deserialization process is encoding and decoding , respectively.
encoding: Converts a Python object encoding into a JSON string
decoding: Converting JSON format string decoding to Python object
For simple data types (string, Unicode, int, float, list, tuple, dict), they can be processed directly.
Json.dumps method handles decoding (decoding) conversions of simple data types to simple data type encodingjson.loads methods
=============================
Python parsing json file:
1.json file to be saved in encoded format ANSI
Double quotes are required in the 2.json file, and single quotation marks are used to error.
Parse Case:
Python parsing JSON case 2:
Python parsing json file