一种字典形式储存数据的方式
import datetime, shelve
d = shelve.open('shelve_test.txt')
info = {'age':22, 'job':'it')
name = ['alex', 'rain', 'test']
d['name'] = name
d['info'] = info
d['date'] = datetime.datetime.now()
d.close()
d = shelve.open('shelve_test.txt')
print(d.get('test'))
print(d.get('name'))
print(d.get('time'))
d.close()