Python中序列化处理之——marshal和cPickle篇
摘要:
#!/usr/bin/python#coding=utf-8import osimport marshal,cPickle"""marshal只能序列化有限的类型而cPickle能够序列化自定义的类型"""class Foo: def __init__(self, name): self.name = name def __str__(self): return self.nameo=range(0,10)L = Foo("Goodspeed")cls = [marshal,cPickle]for c in cls 阅读全文
posted @ 2011-11-08 14:51 Goodspeed 阅读(1213) 评论(0) 推荐(0) 编辑