serialize dictionary type

Steve Menard steve.menard at polyester.com
Tue Aug 13 21:14:01 CEST 2002


"Axel Bock" <news-and-lists at the-me.de> wrote in message
news:pan.2002.08.13.18.32.59.378213.6040 at the-me.de...
> Hi,
>
> this may be a stupid question, but all I need to bring my product to a
> somewhat useable state now is to know how I can save dictionaries into a
> database (mysql).
>
> to save it into a file would be sufficient as well :-))
> (as long as i can SAVE it somehow :^))
>
>
> greetings and thanks in advance,
>
> axel.
>

look at the pickle and cPickle modules. It will allow you to serialize any
(almost) python object to a string, that you can then save to a file in in a
database. Both modules implement the same functionality, but cPickle, being
written in C, is a lot faster.


                Steve





More information about the Python-list mailing list