Python object persistence for dictionary like object : Shelve : Database PYTHON examples


PYTHON examples » Database » Shelve »

 

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']            

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Database
» Shelve