Retrieving Entries from a DBM File : DBM : Database PYTHON TUTORIALS


PYTHON TUTORIALS » Database » DBM »

 

Retrieving Entries from a DBM File


import anydbm

cityDB = anydbm.open("city.dbm"'r')
timeDB = anydbm.open("time.dbm"'r')

flights = cityDB.keys()

print "Arrivals"
for flight in flights:
    print ("Flight %s arrives from %s at %s" (flight, cityDB[flight], timeDB[flight]))


cityDB.close()
timeDB.close()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Database
» DBM