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

import shelve

def makeshelve(name, table):
    db = shelve.open(name)
    for key in table.keys():
        db[key] = table[key]
    db.close

if __name__ == '__main__':
    table = {'larry': [2,'perl'], 'john': [3,'tcl'], 'guido': [1,'python']}
    makeshelve('testdb', table)



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