dbm数据库

import dbm
db = dbm.open('definitions', 'c')
db['mustard'] = 'yellow'
db['ketchup'] = 'red'
db['pesto'] = 'green'

print(len(db)) #3
print(db['pesto']) #b'green'

db.close()

db = dbm.open('definitions', 'r')
print(db['mustard']) #b'yellow'
原文地址:https://www.cnblogs.com/jzm17173/p/5739914.html