我创建了一个伯克利数据库,并使用 bsddb 模块对其进行操作。我需要以一种风格存储信息,如下所示:
username = '....'
notes = {'name_of_note1':{
'password':'...',
'comments':'...',
'title':'...'
}
'name_of_note2':{
#keys same as previous, but another values
}
}
这就是我打开数据库的方式
db = bsddb.btopen['data.db','c']
我怎么做 ?