PYTHON ADVANCED - 13: DECORATORS

 IN THIS TUTORIAL, YOU WILL LEARN ABOUT DECORATORS.

# @mydecorator
def dosomething():
    pass

def start_end_decorator(func):

    def wrapper():
        print('Start')
        func()
        print('End')
    return wrapper    


def print_name():
    print('Alex')

print_name = start_end_decorator(print_name)

print_name()

Comments