title: How do I read Berkeley DB files with Python?
body: <p>How do I read Berkeley DB files with Python?</p>
  
  <p>I have this file ...</p>
  
  <pre><code>    [root@dhcp-idev1 ndb]# file dhcp.ndb 
      dhcp.ndb: Berkeley DB (Btree, version 9, native byte-order)
  </code></pre>
  
  <p>... so I figure I can do this ...</p>
  
  <pre><code>    [root@dhcp-idev1 ndb]# python2.3 
      Python 2.3.4 (#1, Jul 16 2009, 07:01:37) 
      [GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      &gt;&gt;&gt; import anydbm
      &gt;&gt;&gt; anydbm.open( './dhcp.ndb' )
  </code></pre>
  
  <p>... but I get this error message ...</p>
  
  <pre><code>    Traceback (most recent call last):
        File "&lt;stdin&gt;", line 1, in ?
        File "/usr/lib/python2.3/anydbm.py", line 80, in open
          raise error, "db type could not be determined"
      anydbm.error: db type could not be determined
      &gt;&gt;&gt; 
  </code></pre>
  
  <p>... what am I doing wrong?</p>