> Briefly:
>
> s = cPickle.dumps(obj)
> z = zipfile.Zipfile("filename.zip","w",zipfile.ZIP_DEFLATED)
> z.writestr("arcname.pkl",s)
Thank you very much. I have not been aware that pickle can also do the
job without a file!
Here's the complete scenario for writing and reading the data...
APPENDIX:
On Sep 16, 4:40 am, Thomas Lehmann 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
--
http://mail.python.org/mailman/listinfo/py