# -*- coding: utf-8 -*- import pickle #直列化 with open('data.pkl', 'wb') as f: pickle.dump([1,2,3], f) #非直列化 with open('data.pkl', 'rb') as f: d = pickle.load(f) print d
詳細はドキュメントで
# -*- coding: utf-8 -*- import pickle #直列化 with open('data.pkl', 'wb') as f: pickle.dump([1,2,3], f) #非直列化 with open('data.pkl', 'rb') as f: d = pickle.load(f) print d
OSはUbuntu 9.04
PythonはPython 2.6.2
0 件のコメント:
コメントを投稿