#!/home/songxinkai/anaconda3/bin/python
def func0(input_func):
    def output_func():
        print ("func 0 start")
        input_func()
        print ("func 0 finish")
    return output_func

def func1(input_func):
    def output_func():
        print ("func 1 start")
        input_func()
        print ("func 1 finish")
    return output_func

def func2(input_func):
    def output_func():
        print ("func 2 start")
        input_func()
        print ("func 2 finish")
    return output_func

def func3():
    print ("func 3")

@func0
@func1
@func2
def func4():
    print ("func 4")

if __name__ == "__main__":
    func5 = func0(func1(func2(func3)))
    print ("*"*20)
    func5()
    print ("*"*20)
    func4()
    print ("*"*20)
