< A, 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 (deserialization): is to read the state of the deserialized object from the storage area (json,xml) and recreate the object.
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 begins to add JSON modules without additional download, and thePython JSON module serialization and deserialization process is encoding and Decoding
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), you can directly handle ...
< two, Examples app>
1,the Json.dumps method is encoding for simple data types:
Python repr ();
Python json.dumps ();
Convert list to str
2,Json.loads method handles decoding (decoding) conversions of simple data types
JSON overview and Python processing data types such as JSON