File: class/Extras/Code/people/makedb.py

from person import Person, Manager
bob = Person('bob smith')
sue = Person('sue jones', job='dev', pay=50000)
tom = Manager('tom smith', pay=60000)

import shelve
db = shelve.open('persondb')
db['bob'] = bob
db['sue'] = sue
db['tom'] = tom
db.close()



[Home page] Books Code Blog Python Author Train Find ©M.Lutz