To be a better coder
发布时间:2019-04-05 13:37:09
1 Linux IOMMU Support 2 =================== 3 4 The architecture spec can be obtained from the below location. 5 6 http://www.intel.com/technology/virtualization/ 7 8 This guide gives a quick cheat sheet for some basic understanding. 9 &nbs.........【阅读全文】
发布时间:2019-03-29 13:42:11
[root@localhost /]# cat zlg.py#!/bin/pythonclass zlg(): ha='hahahahahahaha' def a(self): self.ha='enenenenenen' print 'aaaaaaaaaaa' print self&nb.........【阅读全文】
发布时间:2019-03-29 13:29:42
面相对象程序设计中,类方法和静态方法是经常用到的两个术语。逻辑上讲:类方法是只能由类名调用;静态方法可以由类名或对象名进行调用。在C++中,静态方法与类方法逻辑上是等价的,只有一个概念,不会混淆。而在Python中,方法分为三类实例方法、类方法、静态方法。代码如下:class Test(object):def InstanceFun(.........【阅读全文】
发布时间:2019-03-19 13:59:35
[root@localhost /]# [root@localhost /]# [root@localhost /]# cat z.py #!/bin/pythonfrom functools import update_wrapper, wrapsdef a(b,c=3,d=[]): '''aaaaaaaaaaaaaa''' return a*2#print a.__name__#print a.__defaults__#print a.__doc__.........【阅读全文】
发布时间:2019-03-18 15:45:36
修饰器,增加缓存的意义[root@localhost /]# [root@localhost /]# cat zlg.py #!/bin/pythondef a(n,cache=None): if cache is None: cache={} if n in cache: return cache[n] .........【阅读全文】