Staging
v0.5.0
https://github.com/python/cpython
Raw File
Tip revision: d39f5f64538edd6c690fe635926063fb7cac853b authored by cvs2svn on 10 April 1995, 12:32:31 UTC
This commit was manufactured by cvs2svn to create tag 'release12'.
Tip revision: d39f5f6
libdbm.tex
\section{Built-in Module \sectcode{dbm}}
\bimodindex{dbm}

Dbm provides python programs with an interface to the unix \code{ndbm}
database library.  Dbm objects are of the mapping type, so they can be
handled just like objects of the built-in \dfn{dictionary} type,
except that keys and values are always strings, and printing a dbm
object doesn't print the keys and values.

The module defines the following constant and functions:

\renewcommand{\indexsubitem}{(in module dbm)}
\begin{excdesc}{error}
Raised on dbm-specific errors, such as I/O errors. \code{KeyError} is
raised for general mapping errors like specifying an incorrect key.
\end{excdesc}

\begin{funcdesc}{open}{filename\, rwmode\, filemode}
Open a dbm database and return a mapping object.  \var{filename} is
the name of the database file (without the \file{.dir} or \file{.pag}
extensions), \var{rwmode} is \code{'r'}, \code{'w'} or \code{'rw'} to
open the database fore reading, writing or both respectively,
and \var{filemode} is the \UNIX{} mode of the file, used only
when the database has to be created (but to be supplied at all times).
\end{funcdesc}
back to top