Learn To Solve It
Decorator Example
#!/usr/bin/python def my_decorator(fun): def wrapper(*args): print("Before Invocation") fun(*args) print("After Invocation") return wrapper @my_decorator def hello_world(x): print("Hello, World") print(x) hello_world(10)
See also
Suggest a Code Improvement:design_decorator3.py
Suggest a better explanation for design_decorator3.rst
previous
Contextmanager ex
next
Example Iterable