Pickle to source code

Maksim Kasimov maksim.kasimov at gmail.com
Wed Oct 26 12:02:38 CEST 2005



As far i know, in pickle-file there are only attributes values of a pickled object, but not an object itself.

It is possible to unpickle object only if you have the sourse of the class that object you have pickled.
So, if you have class code and attribute values of the class instance, there is no problem to produce a textual representation of the object. Isn't it?

(sorry for my English)

Gabriel Genellina wrote:
> Hello
> 
> I want to convert from pickle format to python source code. That is,
> given an existing pickle, I want to produce a textual representation
> which, when evaluated, yields the original object (as if I had
> unpickled the pickle).
> I know of some transformations pickle/xml (Zope comes with one such
> tool, gnosis xml is another) so I believe I could build something based
> on them.
> But I dont want to reinvent the wheel, I wonder if anyone knows of a
> library which could do what I want?
> 
> Thanks,
> Gabriel Genellina
> Softlab SRL
> 


-- 
Best regards,
Maksim Kasimov
mailto: maksim.kasimov at gmail.com



More information about the Python-list mailing list