@acwoss/

SurprisedGrizzledNerka

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.7509974133429473","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHRpbWUKIAojIERlZmluZSBvIGNvbnRhZG9yIGRlIGZ1bsOnw7VlcyBkZWNvcmFkYXM6CmRlY29yYXRlZF9mdW5jdGlvbnMgPSAwCiAKIyBEZWZpbmnDp8OjbyBkbyBkZWNvcmFkb3I6CmRlZiBkZWNvcmF0b3IoZnVuY3Rpb24pOgogCiAgICAjIEluY3JlbWVudGEgbyBjb250YWRvcjoKICAgIGRlY29yYXRlZF9mdW5jdGlvbnMgKz0gMQogCiAgICAjIEluaWNpYWxpemEgbyBob3LDoXJpbyBkYSDDumx0aW1hIGNoYW1hZGE6CiAgICBsYXN0X2NhbGwgPSBOb25lCiAKICAgICMgRGVmaW5lIGEgZnVuw6fDo28gZGUgcmV0b3JubzoKICAgIGRlZiB3cmFwcGVyKCphcmdzLCAqKmt3YXJncyk6CiAKICAgICAgICAjIEV4aWJlIGUgYXR1YWxpemEgbyBob3LDoXJpbyBkYSDDumx0aW1hIGNoYW1hZGE6CiAgICAgICAgcHJpbnQoIsOabHRpbWEgY2hhbWFkYToiLCBsYXN0X2NhbGwpCiAgICAgICAgbGFzdF9jYWxsID0gdGltZS50aW1lKCkKIAogICAgICAgICMgQ2hhbWEgYSBmdW7Dp8OjbyBkZWNvcmFkYToKICAgICAgICBmdW5jdGlvbigqYXJncywgKiprd2FyZ3MpCiAKICAgIHJldHVybiB3cmFwcGVyCiAgICAKQGRlY29yYXRvcgpkZWYgZm9vKCk6CiAgICBwcmludCgiRm9vIGV4ZWN1dGFkYSIpCiAKZm9vKCk="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import time
 
# Define o contador de funções decoradas:
decorated_functions = 0
 
# Definição do decorador:
def decorator(function):
 
    # Incrementa o contador:
    decorated_functions += 1
 
    # Inicializa o horário da última chamada:
    last_call = None
 
    # Define a função de retorno:
    def wrapper(*args, **kwargs):
 
        # Exibe e atualiza o horário da última chamada:
        print("Última chamada:", last_call)
        last_call = time.time()
 
        # Chama a função decorada:
        function(*args, **kwargs)
 
    return wrapper
    
@decorator
def foo():
    print("Foo executada")
 
foo()