O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

dbhash

The dbhash module is used to open databases using the bsddb module, but with an interface that closely matches the interface of the other database modules.

open(
							filename
							[,flag=’r’ [,
							mode
							])

Opens a DB database and returns the database object. A database object, d, returned by open() behaves like a dictionary and also provides the following methods:

MethodDescription
d.first()Returns the first key in the database
d.last()Returns the last key in a database traversal
d.next(key)Returns the next key following key in the database
d.previous(key)Returns the item that comes before key in a forward traversal of the database
d.sync()Writes unsaved data to the disk
error

Exception raised on database errors other than KeyError. Same as bsddb.error ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required