File: class/Workbook/Exercises/Lab9/per3.py

import shelve, string

def changeshelve(name):
    db = shelve.open(name)
    for key in db.keys():
        row = db[key]
        row[0] = row[0] + 1
        row[1] = string.upper(row[1])
        db[key] = row
    del db['john']

if __name__ == '__main__':
    changeshelve('testdb')



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