It seems you want to save your class instances across sessions, and using pickle is a decent way to do this. If your data is too big to fit into memory, use a database (you have many choices, dbm inst the only thing out there). · there used to be cpickle in python2. 7. Pickling - is the process whereby a python object hierarchy is converted into a byte stream, and unpickling - is the inverse operation, whereby a byte stream is converted back into an object hierarchy. Note that if you keep appending pickle data to the file, you will need to continue reading from the file until you find what you want or an exception is generated by reaching the end of the file. However, this is also gives it the power to serialize almost any python object, without any boilerplate or even white-/black-listing (in the common case). The following is an example of how you might write and read a pickle file. Python 3 no longer distinguishes between cpickle and pickle , always use pickle when using python 3. Pickle is unsafe because it constructs arbitrary python objects by invoking arbitrary functions. · pickle can read and write files in several different, python-specific, formats, called protocols as described in the documentation, protocol version 0 is ascii and therefore human-readable. What would be some sample code that would write a new file and then use pickle. Pickling (and unpickling) is alternatively known as serialization. However, theres a package called klepto that abstracts the saving of objects to a dictionary interface, so you can choose to pickle objects and save them to a file (as shown below), or pickle the objects and save them to a database, or. The pickle / cpickle pair received this treatment. That is what the last function does. What makes you think that two appended pickle streams will somehow be magically accepted as one new object? What ever happened to that module, did it get merged into the regular pickle module? However, i dont see it anymore in python3 pickle. I have looked through the information that the python documentation for pickle gives, but im still a little confused. The stringio module has been turned into a class in the io module. The profile module is on the list for 3. 1. Since it is a python convention that implementation details are prepended with an underscore, cpickle became _pickle. · the pickle module implements a fundamental, but powerful algorithm for serializing and de-serializing a python object structure. Because this is a binary format, make sure to use wb as the file mode! · pickle. dump(d, pfile, protocol= pickle. highest_protocol) pickle. highest_protocol will always be the right version for the current python version.