1. dict 保存为 pickle
mydict = {
"1": 10, "3": 30}
with open("./data/medFile/test.pickle", "wb") as fp: #Picklingpickle.dump(mydict, fp, protocol = pickle.HIGHEST_PROTOCOL)
with open("./data/medFile/test.pickle", "rb") as fp: #Picklingmydict = pickle.load(fp)
mydict