前面学习了pickle,这两个可以将数据持久化存储到硬盘上,在实际应用中,我们可能会多次将数据dump到同一文件里,试一下: import pickle data = {'k1':123, 'k2':123} data1 = {'d1':111, 'd2':222} #先dump一次 with open('data.pkl', 'wb') as f: pickle.dump(data, f) #使用追加模式再dump一次 with open('data.pkl', 'ab') as f: pic…