Python object persistence for dictionary like object : shelve « Database « Python






Python object persistence for dictionary like object

Python object persistence for dictionary like object

import shelve

s = shelve.open('data')

s['key'] = range(4)

print s['key']               

s['key'].append('more')       

print s['key']                    

x = s['key']              

x.append('more')       

s['key'] = x              

print s['key']            

           
       








Related examples in the same category

1.Find a word in shelve file
2.Pickling and shelving dataPickling and shelving data