Mundo em Python

Imobilização de Judo

from tkinter import *

root = Tk()
root.geometry("600x300")
root.resizable(0, 0)
root.config(bg="#103030")
root.title("Iniciar Imobilização") titulo = Label(text="Imobilização",
font=("Arial", "28", "bold"), bg="#103030", fg="#49e3e3")
titulo.place(relx=0.35, rely=0.05) texto_sub1 = Label(text="",
font=("Arial", "18", "bold"), bg="#103030", fg="#49e3e3")
texto_sub1.place(relx=0.2, rely=0.4)
def limpar():
texto_sub1.config(text="")
resultado_texto.config(text="")
def app(tempo=0):
if tempo <= 20:
mensagem = f"Tempo de Imobilização: {tempo}s"
texto_sub1.config(text=mensagem) if tempo == 5:
resultado_texto.config(text="Yuko")
elif tempo == 10:
resultado_texto.config(text="Wazari")
elif tempo == 20:
resultado_texto.config(text="Ippon") # Chama novamente após 1 segundo
root.after(1000, app, tempo + 1)
but1 = Button(text="Começar imobilização", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=lambda: app())
but1.place(relx=0.05, rely=0.25, relwidth=0.35, 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.43, rely=0.25, 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.25, relwidth=0.25, relheight=0.1) resultado_texto = Label(text="",
font=("Arial", 12, "bold"), bg="#cfe2f3")
resultado_texto.place(relx=0.05, rely=0.65, relwidth=0.9, relheight=0.15) root.mainloop()
0