class Test():
count = 2 # 类变量
def __init__(self):# 初始化数据函数
self.count = 1 # 普通变量
self.__msg = 2 # 私有变量
def __str__(self):# 打印对象时调用,默认返回值是对象内存地址
return '打印对象时调用'
def __del__(self):# 对象销毁时调用
pass
@classmethod
def printCount(cls): # 类函数,接收的参数是类变量
print(cls.count)
def __printMsg(self):# 私有函数,接收的参数是实例变量
print(self.msg)
@staticmethod
def printName(): # 静态函数
print('我不可以接收参数')
class TestChild(Test): # 继承,可以多继承,以逗号分割写在括号内
pass



