Mundo em Python

Principais sinais de alerta AVC

from tkinter import *

root = Tk()
root.geometry("700x400")
root.resizable(0, 0)
root.config(bg="#103030")
root.title("Principais sinais de alerta AVC") titulo = Label(
text="Principais sinais de alerta AVC",
font=("Arial", 28, "bold"),
bg="#103030",
fg="#49e3e3"
)
titulo.place(relx=0.08, rely=0.05) var = StringVar()
dropDownList = ["Sorriso (Face)", "Abraço (Braço)", "Mensagem (Fala)", "Urgência (Tempo)"]
dropdown = OptionMenu(root, var, *dropDownList)
var.set(dropDownList[0])
dropdown.place(relx=0.25, rely=0.25, relwidth=0.45)
dropdown.config(background='#09A3BA', foreground="#FFFFFF", font=("Arial", 20, "bold"))
dropdown["menu"].config(background='#09A3BA', foreground="#FFFFFF", font=("Arial", 20, "bold")) def limpar():
resultado_texto.config(text="") def app():
try:
v = var.get()
if v == "Sorriso (Face)":
mensagem = "A boca fica torta.\nUm lado do rosto não se mexe."
elif v == "Abraço (Braço)":
mensagem = "A pessoa não consegue levantar um braço.\nUm dos braços fica fraco ou dormente."
elif v == "Mensagem (Fala)":
mensagem = "A fala fica enrolada, difícil de entender.\nA pessoa não consegue falar ou entende com dificuldade."
elif v == "Urgência (Tempo)":
mensagem = "Procure atendimento imediatamente.\nLigue 192 (SAMU)."

resultado_texto.config(text=mensagem) except ValueError:
resultado_texto.config(text="Erro inesperado.") # Botões
but1 = Button(
text="Mostrar",
bd=2,
bg='#107db2',
fg='white',
font=('verdana', 12, 'bold'),
command=app
)
but1.place(relx=0.1, rely=0.5, relwidth=0.25, relheight=0.1) but_limpar = Button(
text="Limpar",
bd=2,
bg='#107db2',
fg='white',
font=('verdana', 12, 'bold'),
command=limpar
)
but_limpar.place(relx=0.4, rely=0.5, relwidth=0.25, relheight=0.1) but_sair = Button(
text="Sair",
bd=2,
bg='#107db2',
fg='white',
font=('verdana', 12, 'bold'),
command=root.destroy
)
but_sair.place(relx=0.7, rely=0.5, relwidth=0.25, relheight=0.1) resultado_texto = Label(
text="",
font=("Arial", 12, "bold"),
bg="#cfe2f3"
)
resultado_texto.place(relx=0.05, rely=0.68, relwidth=0.9, relheight=0.3) root.mainloop()
0