save a dictionary in a file

Jeff Shannon jeff at ccvcorp.com
Mon Nov 15 16:41:39 EST 2004


Luis P. Mendes wrote:

>
> my program builds a dictionary that I would like to save in a file.


As others have said, there should be no reason to convert to a list 
before pickling -- AFAIK, there's no ban against pickling dictionaries.

You might also look into the Shelve module, which implements a 
filesystem-persisting object with dictionary access syntax.  (And which, 
IIRC, uses pickled dictionaries under the covers.)

Jeff Shannon
Technician/Programmer
Credit International




More information about the Python-list mailing list