7——1 shelve 模块

mport shelve

f=shelve.open(r'sheve.txt')
# f['stu1_info']={'name':'egon','age':18,'hobby':['piao','smoking','drinking']}
# f['stu2_info']={'name':'gangdan','age':53}
# f['school_info']={'website':'http://www.pypy.org','city':'beijing'}

print(f['stu1_info']['hobby'])
f.close()
posted @ 2018-07-01 06:14  一棵大树一棵小树一棵草  阅读(87)  评论(0)    收藏  举报