pickle.shelve,python私有,支持所有python数据类型 一.pickle dic={'name':'egon','age':18} print(pickle.dumps(dic)) ##得到的是一个bets类型数据 with open('d.pickle','wb') as f: #bets类型需要用wb模式打开 f.write(pickle.dumps(dic)) #序列化 ##反序列化 with open('d.pickle','rb') as f: #bets类型需要用…