Unpickling Objects from a File : cPickle « Database « Python Tutorial






import cPickle

f = open("pickled.dat", "r")

p = cPickle.Unpickler(f)

data = p.load()
print data

data = p.load()
print data

f.close()








15.1.cPickle
15.1.1.Pickling Objects to a File
15.1.2.Unpickling Objects from a File
15.1.3.Opening and writing pickled object to a file.