We use cookies to enhance your browsing experience.

Learn More
Back to Library
PYTHONpython

Decorators

Wrap functions with extra behavior.

def my_decorator(func):
    def wrapper():
        print("Before")
        func()
        print("After")
    return wrapper

@my_decorator
def say_hello():
    print("Hello!")
python advanced syntax
25+Total Tools
Operations
4Languages
100%Privacy

We use cookies to enhance your experience and serve personalized ads.