Advertisement
rfmonk

shelve_create.py

Jan 29th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. import shelve
  2. from contextlib import closing
  3.  
  4. with closing(shelve.open('test_shelf.db')) as s:
  5.     s['key1'] = {'int': 10, 'float': 9.5, 'string': 'Sample data'}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement