14 lines
276 B
Python
14 lines
276 B
Python
#Datei: counter.py
|
|
|
|
def counter(func):
|
|
func.count = 0
|
|
def wrapper(*args, **kwargs):
|
|
func.count = func.count +1
|
|
print(f'{func.__name__} wurde {func.count}-mal aufgerufen.')
|
|
result = func(*args,**kwargs)
|
|
|
|
return result
|
|
wrapper.count = 0
|
|
return wrapper
|
|
|