serialize dictionary type

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

"Axel Bock" <news-and-lists at> wrote in message
news:pan.2002. at
> 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.


More information about the Python-list mailing list