The data format used by the module is dedicated to python. Different versions are not backward compatible and cannot be recognized by other languages. To interact with other languages, you can use the built-in json package to use the pickle module. You can directly save Python objects to files without converting them into strings, you do not need to write the underlying file access operations into a binary file. The pickle module will create a binary format dedicated to the python language. Basically, you don't need to consider any file details. It will help you perform read and write exclusive operations in a clean manner, the only requirement is a valid file handle.
The two main functions in the module are dump () and load (). The dump () function accepts a file handle and a data object as parameters, and saves the data object to a specified file in a specific format. When we use the load () function to extract saved objects from a file,Know how to restore these objects to their original format.
The dumps () function executes the same serialization as the dump () function. Instead of accepting stream objects and saving serialized data to disk files, this function simply returns serialized data.
The loads () function executes the same deserialization as the load () function. Instead of accepting a stream object and reading serialized data from a file, it accepts the str object that contains the serialized data and directly returns the object.
CPickle is pickle to get a faster C language version.
Similar to cPickle, java serialization and deserialization operations
Source: http://www.bkjia.com/kf/201009/74973.html
The following is Example in the python API:
collections MemoRecord = namedtuple(, ( super(). self.connection = cursor = type_tag, key_id = type_tag == cursor.execute( key, task = pickle.UnpicklingError( conn = sqlite3.connect( cursor = cursor.execute( tasks = task cursor.execute( cursor.execute( memos = [MemoRecord(key, task) key, task file = ( cursor.execute( memos = ( == main()