[root@blackfox zhouyuyao]# cat c8.py
#!/usr/bin/python
#coding:utf8
class MyClass(object):
name = 'Test'
def __init__(self):
self.func1()
self.__func2()
self.classFun()
self.staticFun()
def func1(self):
print self.name
print "我是公有方法"
def __func2(self):
print self.name
print "我是私有方法"
@classmethod
def classFun(self):
print self.name
print "我是类方法"
@staticmethod
def staticFun():
print MyClass.name
print "我是静态方法"
mc = MyClass()
#mc.func1()
#mc.__func2()
#MyClass.classFun()
#MyClass.staticFun()