First, JSON module serialization is introduced: Using JSON's Dumps method to deserialize: Using JSON's Loads method procedure: After JSON serialization, you can write the serialized data type to the file, and then read the data type from the file. Then the other methods in the deserialization JSON object are: Dump (info,f) >>> where info is the data that needs to be serialized, F is a file handle; Load (f) >>> Use these two methods not to read and write to the file pickle and JSON use method similar, Just the name is different and pickle can handle complex data types and JSON cannot (pickle is binary read/write) Note: It is worth noting that other languages support JSON and do not support pickle serialization and deserialization there is also a shelve module, which is a further encapsulation of pickle
Python path-json and pickle serialization/deserialization