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

anydbm

The anydbm module provides a generic interface that’s used to open a database without knowing which of the lower-level database packages are actually installed and available. When imported, it looks for one of the bsddb, gdbm, or dbm modules. If none are installed, the dumbdbm module is loaded.

A database object is created using the open() function:

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

This function opens the database file filename and returns a database object. If the database already exists, the whichdb module is used to determine its type and the corresponding database module to use. If the database doesn’t exist, an attempt is made to create it using the first installed module in the preceding list of database modules. flags and

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