GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • index
  • modules
  • next
  • previous
  • Python
  • Python 2.7.18 documentation
  • The Python Standard Library
  • 11. Data Persistence
  • Show Source

This view

  • Original page
  • New address

GeezerVison is showing docs.python.org — 11.7. whichdb — Guess which DBM module created a database — Python 2.7.18 documentation

This document is for an old version of Python that is no longer supported. You should upgrade and read the Python documentation for the current stable release.

11.7. whichdb — Guess which DBM module created a database¶

Note

The whichdb module’s only function has been put into the dbm module in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.

The single function in this module attempts to guess which of the several simple database modules available—dbm, gdbm, or dbhash—should be used to open a given file.

whichdb.whichdb(filename)¶

Returns one of the following values: None if the file can’t be opened because it’s unreadable or doesn’t exist; the empty string ('') if the file’s format can’t be guessed; or a string containing the required module name, such as 'dbm' or 'gdbm'.

© Copyright 1990-2020, Python Software Foundation.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Jun 19, 2020. Found a bug?
Created using Sphinx 2.3.1.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.