Python Language Sample code for shelve


Example

To shelve an object, first import the module and then assign the object value as follows:

import shelve 
 database = shelve.open(filename.suffix) 
 object = Object() 
 database['key'] = object