import shelvenewtimes = ["110pm", "220pm", "300pm", "445pm"]db = shelve.open("shelved.dat", "w", writeback=1)for k in db.keys(): obj = db[k] print "%s: %s" % (k, obj)flights = db['flights']times = db['times']flights['1145'] = "Dallas"flights['1709'] = "Orlando"db['times'] = newtimesdb['oldtimes'] = timesdb.sync()for k in db.keys(): obj = db[k] print "%s: %s" % (k, obj)db.close()
Name (required)
email (will not be published) (required)
Website