[BangPypers] Pickle a dictionary
kausikram krishnasayee
kausikram at gmail.com
Mon Mar 1 10:02:30 CET 2010
>
> Hi all,
>
> I have to pickle a dictionay and store it in a postgres database. There
> are a number of resources for pickling into a file, but what should I do
> to pickle the dictionary in to database? I have blob datatype (bytea) for
> that field in postgres.
>
> Regards,
> Manikandan K
>
pickle it into a string and store the string into the database.
>>>import pickle
>>>pickle_string=pickle.dump(dict)
>>>#use your database api to store pickle_string
--
Kausikram Krishnasayee
Company: http://silverstripesoftware.com | Webpage: kausikram.net | Blog:
blog.kausikram.net | Twitter: http://twitter.com/kausikram | Email:
kausikram at gmail.com | Mobile: +91 9884246490
More information about the BangPypers
mailing list