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

dbm

The dbm module provides an interface to the UNIX dbm library.

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

Opens a dbm database and returns a dbm object. Here, filename is the name of the database file (without the .dir or .pag extension). The returned object behaves like a dictionary, as described in the “Introduction” section earlier in this chapter.

error

Exception raised for dbm-specific errors other than KeyError.

Note

This module should work with a variety of different UNIX databases, including ndbm databases, BSD DB compatibility interfaces, and the GNU GDBM compatibility interface.

See Also

anydbm (p. 238), gdbm (p. 241)

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