#changed all email address to go through python.org
[python/dscho.git] / Doc / libdbm.tex
blob7e004d28dd89edaa89e4dc318eef575b86028b18
1 \section{Built-in Module \sectcode{dbm}}
2 \bimodindex{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.
16 \end{excdesc}
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'} to
22 open the database fore reading, writing or both respectively,
23 and \var{filemode} is the \UNIX{} mode of the file, used only
24 when the database has to be created (but to be supplied at all times).
25 \end{funcdesc}