11.7. whichdb — Guess which DBM module created a database - Python 2.7.18 documentation 编辑
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'
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论