Advertisement
rfmonk

anydbm_existing.py

Jan 29th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. import anydbm
  2.  
  3. db = anydbm.open('/tmp/example.db', 'r')
  4. try:
  5.     print 'keys():', db.keys()
  6.     for k, v in db.iteritems():
  7.         print 'iterating:', k, v
  8.     print 'db["author"] = ', db['author']
  9. finally:
  10.     db.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement