摘要: 单例:即一个类只能生成唯一的一个实例,python中的类如果没有被实例化,则cls._instance为None 如下: class Singleton(object): def __new__(cls,*args,**kw): if not hasattr(cls,"_instance"): or 阅读全文
posted @ 2018-03-28 23:24 reyinever 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 1.json串转化成xml文件 p=[{"name":"tom","age":30,"sex":"男"}, {"name":"lily","age":23,"sex":"女"}, {"name":"joy","age":40,"sex":"女"}] import xml.dom.minidom do 阅读全文
posted @ 2018-03-28 22:03 reyinever 阅读(364) 评论(0) 推荐(0) 编辑