摘要: 参看原帖,简单翻译此帖的内容method 1:从PEP318看到singleton的实现def singleton(cls): instances = {} def get_instance(): if cls not in instances: instances[cls] = cls() return instances[cls] return get_instance@singletonclass MyClass: pass如果直接通过类似m=MyClass()这样生成对象,那么就是singleton对象,但如果通过n.__class__()这样生成的,就不... 阅读全文
posted @ 2011-10-15 16:31 kebo 阅读(1133) 评论(0) 推荐(0) 编辑
摘要: 卸载rar,unrar包安装p7zip-full,p7zip-rar包apt-get remove rar unrarapt-get install p7zip-full p7zip-rar 阅读全文
posted @ 2011-10-15 16:01 kebo 阅读(216) 评论(0) 推荐(0) 编辑