shelve object back to dictionary

Ryan Krauss ryanlists at gmail.com
Thu Oct 6 11:44:11 EDT 2005


Is there an easy way to convert a shelved object back to a dictionary?
 When I save a dictionary using shelve and then load it in a later
session, I have an object whose property names are the keys of the
dictionary used as an input to shelve.  For example, instead of
user['name'] I have user.name.  I would prefer to have the scripts I
write to analyze the saved data have a similar syntax to the ones I
used to create it, so I would rather deal with a dictionary after I
load the shelved data.

Ryan


More information about the Python-list mailing list