PyDocs

Nav

Data Persistence

open

dbm

function (source)
  • open(file, flag='r', mode=0o666)
Open or create database at path given by *file*.

Optional argument *flag* can be 'r' (default) for read-only access, 'w'
for read-write access of an existing database, 'c' for read-write access
to a new or existing database, and 'n' for read-write access to a new
database.

Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it
only if it doesn't exist; and 'n' always creates a new database.
Changed in 3.11
  • 3.11: file accepts a path-like object.
0 Examples
No examples for dbm/open.
See Also
No see-alsos for dbm/open
0 Notes
No notes for open