1 \section{Built-in Module
\sectcode{dbm
}}
4 Dbm provides python programs with an interface to the unix
\code{ndbm
}
5 database library. Dbm objects are of the mapping type, so they can be
6 handled just like objects of the built-in
\dfn{dictionary
} type,
7 except that keys and values are always strings, and printing a dbm
8 object doesn't print the keys and values.
10 The module defines the following constant and functions:
12 \renewcommand{\indexsubitem}{(in module dbm)
}
13 \begin{excdesc
}{error
}
14 Raised on dbm-specific errors, such as I/O errors.
\code{KeyError
} is
15 raised for general mapping errors like specifying an incorrect key.
18 \begin{funcdesc
}{open
}{filename\, rwmode\, filemode
}
19 Open a dbm database and return a mapping object.
\var{filename
} is
20 the name of the database file (without the
\file{.dir
} or
\file{.pag
}
21 extensions),
\var{rwmode
} is
\code{'r'
},
\code{'w'
} or
\code{'rw'
} as for
22 \code{open
}, and
\var{filemode
} is the unix mode of the file, used only
23 when the database has to be created.