@acwoss/

DelectableImperfectIchthyosaurs

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.8483989974177957","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHRpbWUKCiMgRGVmaW5lIG8gY29udGFkb3IgZGUgZnVuw6fDtWVzIGRlY29yYWRhczoKZGVjb3JhdGVkX2Z1bmN0aW9ucyA9IDAKCiMgRGVmaW5pw6fDo28gZG8gZGVjb3JhZG9yOgpkZWYgZGVjb3JhdG9yKGZ1bmN0aW9uKToKICAgIAogICAgIyBJbXBvcnRhIHBhcmEgbyBlc2NvcG8gbG9jYWwgYSB2YXJpw6F2ZWwgZ2xvYmFsOgogICAgZ2xvYmFsIGRlY29yYXRlZF9mdW5jdGlvbnMKICAgIAogICAgIyBJbmNyZW1lbnRhIG8gY29udGFkb3I6CiAgICBkZWNvcmF0ZWRfZnVuY3Rpb25zICs9IDEKICAgIAogICAgIyBJbmljaWFsaXphIG8gaG9yw6FyaW8gZGEgw7psdGltYSBjaGFtYWRhOgogICAgbGFzdF9jYWxsID0gTm9uZQogICAgCiAgICAjIERlZmluZSBhIGZ1bsOnw6NvIGRlIHJldG9ybm86CiAgICBkZWYgd3JhcHBlcigqYXJncywgKiprd2FyZ3MpOgogICAgICAgIAogICAgICAgICMgSW1wb3J0YSBwYXJhIG8gZXNjb3BvIGxvY2FsIGEgdmFyacOhdmVsOgogICAgICAgIG5vbmxvY2FsIGxhc3RfY2FsbAogICAgICAgIAogICAgICAgICMgRXhpYmUgZSBhdHVhbGl6YSBvIGhvcsOhcmlvIGRhIMO6bHRpbWEgY2hhbWFkYToKICAgICAgICBsYXN0X2NhbGwgPSB0aW1lLnRpbWUoKQogICAgICAgIHByaW50KCLDmmx0aW1hIGNoYW1hZGE6IiwgbGFzdF9jYWxsKQogICAgICAgIAogICAgICAgICMgQ2hhbWEgYSBmdW7Dp8OjbyBkZWNvcmFkYToKICAgICAgICBmdW5jdGlvbigqYXJncywgKiprd2FyZ3MpCiAgICAgICAgCiAgICByZXR1cm4gd3JhcHBlcgogICAgCkBkZWNvcmF0b3IKZGVmIGZvbygpOgogICAgcHJpbnQoIkZvbyBleGVjdXRhZGEiKQogICAgCmZvbygp"},"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
32
33
34
35
36
37
import time

# Define o contador de funções decoradas:
decorated_functions = 0

# Definição do decorador:
def decorator(function):
    
    # Importa para o escopo local a variável global:
    global decorated_functions
    
    # 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):
        
        # Importa para o escopo local a variável:
        nonlocal last_call
        
        # Exibe e atualiza o horário da última chamada:
        last_call = time.time()
        print("Última chamada:", last_call)
        
        # Chama a função decorada:
        function(*args, **kwargs)
        
    return wrapper
    
@decorator
def foo():
    print("Foo executada")
    
foo()