存储数组/持久的方式。
#!/usr/bin/pythonimport cPickle as pshoplist_file='shoplist.data'shoplist=['dede','dede2','dede3']f=file(shoplist_file,'w')p.dump(shoplist,f)f.close()del shoplistf=file(shoplist_file)print p.load(f)
本文共 278 字,大约阅读时间需要 1 分钟。
存储数组/持久的方式。
#!/usr/bin/pythonimport cPickle as pshoplist_file='shoplist.data'shoplist=['dede','dede2','dede3']f=file(shoplist_file,'w')p.dump(shoplist,f)f.close()del shoplistf=file(shoplist_file)print p.load(f)
转载于:https://www.cnblogs.com/xiaoCon/archive/2013/03/06/2947158.html