Store dictionary in database
问题 I create a Berkeley database, and operate with it using bsddb module. And I need to store there information in a style, like this: username = '....' notes = {'name_of_note1':{ 'password':'...', 'comments':'...', 'title':'...' } 'name_of_note2':{ #keys same as previous, but another values } } This is how I open database db = bsddb.btopen['data.db','c'] How do I do that ? 回答1: So, first, I guess you should open your database using parentheses: db = bsddb.btopen('data.db','c') Keep in mind that