You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
276 B
13 lines
276 B
#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
|
|
|
|
|