file['batman''ka-boom!del file['robin'file close(change batman slot delete the robin entry close it after changes apart from having to import the interface and open and close the dbm filepython programs don' have to know anything about dbm itself dbm modules achieve this integration by overloading the indexing operations and routing them to more primitive library tools but you' never know that from looking at this python code--dbm files look like normal python dictionariesstored on external files changes made to them are retained indefinitelyc:\pp \dbasepython import dbm open dbm file again file dbm open('movie'' 'for key in fileprint(key decode()file[keydecode()cat-woman splatbatman ka-boomjoker whamas you can seethis is about as simple as it can be table - lists the most commonly used dbm file operations once such file is openedit is processed just as though it were an in-memory python dictionary items are fetched by indexing the file object by key and are stored by assigning to key table - dbm file operations python code action description import dbm import get dbm implementation file=dbm open('filename'' 'open create or open an existing dbm file for / file['key''valuestore create or change the entry for key value file['key'fetch load the value for the entry key count len(filesize return the number of entries stored index file keys(index fetch the stored keys list (not viewfound 'keyin file query see if there' an entry for key del file['key'delete remove the entry for key for key in fileiterate iterate over stored keys file close(close manual closenot always needed dbm files