import 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‘:‘‘,‘city‘:‘beijing‘} print(f[‘stu1_info‘][‘hobby‘]) f.close()