[Tutor] Explanation of Pickle

Alan Gauld alan.gauld at btinternet.com
Tue Jan 30 11:24:24 CET 2007


"vanam" <vgvr620034 at gmail.com> wrote

> can any one explain about pickle i read in the book but they have 
> not
> provided any example for that so please explain with a simple 
> example

Conceptually it is very simple. Pickle takes a python object
and serialises it to a sequence of bytes which it stores in a
text file. The text file can be unpickled by reading it back
and de-serialising it. The object you wind up with should be
exactly the same as the object you started with. The idea
being that you can store (or persist) your objects even while
your program is not running. The pickle module provides the
functions to do all of that.

Are there  any more specific problems you are having?

Alan G. 




More information about the Tutor mailing list