This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, session, escape, request, redirect, url_for | |
from os import urandom | |
app = Flask(__name__) | |
app.debug = True | |
app.secret_key = urandom(24) | |
@app.route('/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime as dt | |
agora = dt.datetime.now() | |
data = agora.strftime("%d-%m-%Y") | |
hora = agora.strftime("%H:%M") | |
codigo_html = f''' | |
<!DOCTYPE html> | |
<html> | |
<head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def maiuscula(funcao): | |
def wrapper(texto): # função que modifica | |
return funcao(texto.upper()) # transforma pra maiúscula | |
return wrapper # retorna a função modificadora | |
@maiuscula | |
def imprimir_mensagem(nome): | |
print(f"Olá {nome}, \nSeja bem vindo!") |