I've spent hours searching for examples of how to use the bsddb module and the only ones that I've found are these (from here):
data = mydb.get(key)
if data:
doSomething(data)
#####################
rec = cursor.first()
while rec:
print rec
rec = cursor.next()
#####################
rec = mydb.set()
while rec:
key, val = r...
Do the following on the default Python install on Mac OS X 10.5 (Leopard) w/ Developer Tools:
noel ~ : python
Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import bsddb
Traceback (most recent call last):
File "<s...
Say I have a simple table that contains username, firstname, lastname.
How do I express this in berkeley Db?
I'm currently using bsddb as the interface.
Cheers.
...
I am using a berkdb to store a huge list of key-value pairs but for some reason when i try to access some of the data later i get this error:
try:
key = 'scrape011201-590652'
contenttext = contentdict[key]
except:
print the error
<type 'exceptions.KeyError'> 'scrape011201-590652' in
contenttext = contentdict[key]\n', ' F...