python学习-51 shelve模块
import shelve f=shelve.open(r'shelve') #f['stu_info'] = {'name':'john','age':'18'} #f['stu2_info'] = {'name':'tom','age':'20'} #f['stu3_info'] = {'name':'jey','age':'19'} #f.close() print(f.get('stu_info')['name'])
import shelve f=shelve.open(r'shelve') #f['stu_info'] = {'name':'john','age':'18'} #f['stu2_info'] = {'name':'tom','age':'20'} #f['stu3_info'] = {'name':'jey','age':'19'} #f.close() print(f.get('stu_info')['name'])