C
cocobear
How to deal with multiple databases in an file. I want to get the
content of several databases.
it's the code I wrote:
[cocobear@cocobear ~]$ python
Python 2.5.1 (r251:54863, Oct 30 2007, 13:54:11)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
'\x04\x00\x00\x00', '\x05\x00\x00\x00']
the program stop here.
content of several databases.
it's the code I wrote:
[cocobear@cocobear ~]$ python
Python 2.5.1 (r251:54863, Oct 30 2007, 13:54:11)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
['\x01\x00\x00\x00', '\x02\x00\x00\x00', '\x03\x00\x00\x00',import bsddb
import os
import time
db_file = 'native.db'
db = bsddb.db.DB()
db.open(db_file,bsddb.db.DB_UNKNOWN,bsddb.db.DB_RDONLY)
dbs = db.keys()
db.open(db_file,dbs[0],bsddb.db.DB_UNKNOWN,bsddb.db.DB_RDONLY)
db.keys()
'\x04\x00\x00\x00', '\x05\x00\x00\x00']
db.open(db_file,dbs[1],bsddb.db.DB_UNKNOWN,bsddb.db.DB_RDONLY)
the program stop here.