Python by Swaroop C H - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Pickle

Python provides a standard module calledpickle using which you can store any Python object in a file and then get it back later intact. This is called storing the object persistently.

There is another module called cPickle which functions exactly same as thepickle module except that it is written in the C language and is (upto 1000 times) faster. You can use either of these modules, although we will be using thecPickle module here. Remember though, that we refer to both these modules as simply thepickle module.