Source

wd_pys60 / wd_db_test.py

Full commit
def f(*x):
    return x
#print map(f,range(2))
#print reduce(f,range(2))
import e32dbm
import random
import time
path="e:\\wd_db_test"
value=str(reduce(f,range(345)))
def save(key,value):
    db[key]=value
db = e32dbm.open(path, 'c')
stime=time.clock()
def generateTestData(num=50):
    for i in range(num):
        key=str(random.randint(0,1234))
        #key=str(i)
        db[key]=value
        #print i,key
def displayData(db):
    KEYS=db.keys()
    print len(KEYS)
    for i in KEYS:
        print i
displayData(db)
generateTestData(65)
print time.clock()-stime