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.
Exception raised for dbm-specific errors other than KeyError.
This module should work with a variety of different UNIX databases, including ndbm databases, BSD DB compatibility interfaces, and the GNU GDBM compatibility interface.