Zipped and pickle

Carl Banks pavlovevidence at gmail.com
Wed Sep 16 21:54:37 CEST 2009


On Sep 16, 4:40 am, Thomas Lehmann <Iris-und-Thomas-Lehm... at T-
Online.de> wrote:
> How do I implement best to use pickle that way that the file is zipped?

Briefly:

s = cPickle.dumps(obj)
z = zipfile.Zipfile("filename.zip","w",zipfile.ZIP_DEFLATED)
z.writestr("arcname.pkl",s)


Carl Banks



More information about the Python-list mailing list