Python 类 装饰器
class Test:
def __init__(self,a):
self.a = a
print("---->>>a")
def der(func):
def war(m):
print("-------22")
func()
print('over')
return war
class aa:
@Test.der
def show():
print('hello')
asefef = aa()
asefef.show()
F:\python\python.exe D:/abaqus_file/pyqt5_lianxi/02/lei_zhuangshiqi01.py
-------22
hello
over
Process finished with exit code 0