whichdb

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'.

© 2001–2017 Python Software Foundation
Licensed under the PSF License.
https://docs.python.org/2.7/library/whichdb.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部