[root@localhost /]# cat zlg.py
#!/bin/python
class zlg():
ha='hahahahahahaha'
def a(self):
self.ha='enenenenenen'
print 'aaaaaaaaaaa'
print self
print zlg.ha
print self.ha
@classmethod
def b(cls):
print 'bbbbbbbbbbb'
print cls
print cls.ha
# print self.ha
@staticmethod
def c():
print 'ccccccccccc'
print zlg.ha
# print self.ha
e=zlg()
e.a()
e.b()
e.c()
#zlg.a()
zlg.b()
zlg.c()
[root@localhost /]#
[root@localhost /]#
阅读(2014) | 评论(0) | 转发(0) |