09 2013 档案
摘要:# helper class defined elsewhereclass CallLogger(object): def __init__(self, meth): self.meth = meth self.was_called = False def __call__(self, code=None): self.meth() self.was_cal...
阅读全文
摘要:访问顺序: 实例的__getattribute__()、Descriptor的__get__()、实例的__dict__、只读Descriptor的__get__()、实例的__getattr__(); 实例的__setattr__()、Descriptor的__set__()、实例的__dict__; 实例的__delattr__()、Descriptor的__delete_...
阅读全文
摘要:Enclose in parentheses: except (IDontLIkeYouException, YouAreBeingMeanException) as e: passSeparating the exception from the variable with a comma will still work in Python 2.6 and 2.7, but is now...
阅读全文
摘要:Use __new__ when you need to control the creation of a new instance. Use __init__ when you need to control initialization of a new instance. __new__ is the first step of instance creation. It's ...
阅读全文
摘要:发现找不到matplotlib.sphinxext.mathmpl: 可以直接easy_install matplotlib,也可以去这里下载安装包 发现exception: matplotlib requires dateutil错误: 到这里找dateutil安装包(坑爹的easy_install里找不到这个包) 发现exception: matplotlib requ...
阅读全文
摘要:桌面下高速文件搜索软件:Listary Pro(收费)和Everything(开源免费),Everything推荐Beta版,明显比老旧的稳定版好用。 桌面太乱,可以试试Fences(收费)。 需要文件同步,Windows下的cwRsync(免费)相当好用,有服务器端和客户端两部分,分享下带扩展名过滤的rsyncd.conf配置文件: use chroot = fals...
阅读全文