import pickle
data = [1, 2, 3 , 'a']
# 保存
with open('data.pickle', 'wb') as f:
pickle.dump(data, f)
# 读取
with open('data.pickle', 'rb') as f:
b = pickle.load(f)
pickle
最新推荐文章于 2021-08-06 16:55:49 发布
import pickle
data = [1, 2, 3 , 'a']
# 保存
with open('data.pickle', 'wb') as f:
pickle.dump(data, f)
# 读取
with open('data.pickle', 'rb') as f:
b = pickle.load(f)