python文件读写——pickle

import pickle
data=[[1,2,3],1,2,3]
save=open("save.dat",'wb')
pickle.dump(data,save)
save.close()

import pickle
load=open("save.dat",'rb')
data=pickle.load(load)
load.close()
print(data)

你可能感兴趣的:(Python)