The shelve
module, shown in Example 10-3, uses the database handlers to implement persistent
dictionaries. A shelve
object uses string keys, but the value can be
of any datatype, as long as it can be handled by the pickle
module.
Example 10-4 shows how to use the shelve
module with a given database driver.
3.141.3.175