Hi Dillup,
One other comment other than the zipfile stuff: you might want to
consider something other than pickle format if you want
interchangeability with other tools. JSON, for example, is pretty
well-supported in the json library:
https://docs.python.org/2/library/json.html
and it has
> now if i do this
>
> outfile = cStringIO.StringIO()
> outfile.write(pyfromzip)
> z=cPickle.load(outfile)
Do you have to rewind the outfile so that the read is properly
positioned? The following interaction:
#
>>> import StringIO
>>> out = StringIO.StringIO()
>>> ou
http://stackoverflow.com/questions/3006727/load-a-pickle-file-from-a-zipfile
zf = czipfile.ZipFile(r"cpickletest.zip")
pyfromzip = zf.read ("cPickletest.py", pwd="python")
print pyfromzip, type(pyfromzip)
this prints the following to the console
(dp1
S'kola.jpg'
p2
S'CSVTQq#w.@lm'
p3
sS'p2.jpg'
On 29/08/14 10:00, diliup gabadamudalige wrote:
pload = cPickle.load(zf.open("my.py",pwd=password))
this gives an EOF
. Does any body know why?
I've never used zipfile so I don't know, but could it be
related to the fact that your pickle file is binary?
Do you need any flags to tell zipfile t
HI! To all,
with open(from_dir + "\\" + name_py,"wb") as outfile:
cPickle.dump(str1,outfile)
after doing above I zip the file with some other files into a password
secured zip file using win rar.
I can extract all other files except the py file.
pload = cPickle.load(zf.open("my.py",pwd=passw