shelve file name extention

Fredrik Lundh fredrik at pythonware.com
Thu Sep 11 14:31:44 EDT 2008


Monu wrote:

> So Can't I choose which module to use. Is there any preferance on
> which shelve chooses these modules?

it uses the anydbm module to look for available DBM-style drivers, which 
looks for modules in the following order: dbhash, gdbm, dbm, dumbdbm.

if you know which one you want, you can open the database file yourself, 
and pass it to the Shelf constructor:

     import shelve
     import somedbm

     db = shelve.Shelf(somedbm.open(file, flag))

</F>




More information about the Python-list mailing list