def set_func1(func): def call_func(*args, **kwargs): print('....权限1.....') return func(*args, **kwargs) return call_func def set_func2(func): # print('装饰器开始装饰了...') def call_func(*args, **kwargs): print('....权限2.....') return func(*args, **kwargs) return call_func @set_func1 # 先装饰下面的,再装饰上面的,所以先打印权限1再打印权限2 @set_func2 def test1(): print(".......这是test1......") return 'ok' test1()