python -- 文档系列化

#test for pickle
#import pickle as p;
import cPickle as p;

lsShop = ['apple', 'mango', 'carrot'];
strFile = "lsShop.txt";
#write to file
f = file(strFile, "w");
p.dump(lsShop, f);#dump the object
f.close();

del lsShop;

#read back from the storage
f = file(strFile, "r");
lsShop = p.load(f);
f.close();

print lsShop;
 

你可能感兴趣的:(apple,python,F#)