[code.view]

[top] / python / PyMOTW / anydbm / anydbm_existing.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2008 Doug Hellmann All rights reserved.
     #
     """
     """
     
     __version__ = "$Id$"
     #end_pymotw_header
     
     import anydbm
     
     db = anydbm.open('/tmp/example.db', 'r')
     try:
         print 'keys():', db.keys()
         for k, v in db.iteritems():
             print 'iterating:', k, v
         print 'db["author"] =', db['author']
     finally:
         db.close()

[top] / python / PyMOTW / anydbm / anydbm_existing.py

contact | logmethods.com