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


Warning: Unknown: open(/var/lib/php/session/sess_9i2rlp42n1ql90qca6hlp754l1, O_RDWR) failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0