unpickle to python list

Gerhard Häring gerhard.haering at opus-gmbh.net
Mon Feb 3 07:23:42 EST 2003


Thomas Guettler <zopestoller at thomas-guettler.de> wrote:
> Hi!
> 
> I have a pickle which contains a flat list:
> 
> mylist=[
>   "abc",
>   "def",
>   "ghi", ...]
> 
> Is it possible to pickle this list to python syntax? [...]

Hmm. Maybe you can rip some parts out of Twisted?

<quote source="http://twistedmatrix.com/documents/howto/basics">
TAS
    Twisted contains twisted.persisted.aot, a module that supports
    serializing into Python source. This has the advantage of using
    Python's own parser and being able to later manually add Python
    code to the file.
</quote>

There also seem to be various xml-pickles floating around. This might
be an alternative provided you consider XML to be human-readable ;-)

Gerhard
-- 
Gerhard Häring
OPUS GmbH München
Tel.: +49 89 - 889 49 7 - 32
http://www.opus-gmbh.net/




More information about the Python-list mailing list