import bsddb.dbshelve def main(): shelve = bsddb.dbshelve.open("foo.db", "w") shelve["a"] = 1 print list(shelve) if __name__ == "__main__": main()