标签:style blog http color os strong 文件 数据 sp
概念:
[root@likun python_scripts]# cat 15pickle_dump.py #!/usr/bin/python import pickle account_info={ ‘01‘:[‘mima‘,15000,15000], ‘02‘:[‘mima‘,2000,2000] } f=open(‘acc.txt‘,‘wb‘) pickle.dump(account_info,f) f.close()
[root@likun python_scripts]# cat 16pickle_load.py #!/usr/bin/python import pickle f=open(‘acc.txt‘,‘r‘) info=pickle.load(f) f.close() info[‘02‘][1]=20000 f=open(‘acc.txt‘,‘w‘) pickle.dump(info,f) f.close()
标签:style blog http color os strong 文件 数据 sp
原文地址:http://www.cnblogs.com/kissdb/p/4009603.html