import random
from tkinter import *
numeros_de_telefone = [
"912345678", "913234567", "914567890", "915678901", "916789012",
"917890123", "918901234", "919012345", "920123456", "921234567",
"922345678", "923456789", "924567890", "925678901", "926789012",
"927890123", "928901234", "929012345", "930123456", "931234567",
"932345678", "933456789", "934567890", "935678901", "936789012",
"937890123", "938901234", "939012345", "940123456", "941234567",
"942345678", "943456789", "944567890", "945678901", "946789012",
"947890123", "948901234", "949012345", "950123456", "951234567",
"952345678", "953456789", "954567890", "955678901", "956789012",
"957890123", "958901234", "959012345", "960123456", "961234567",
"962345678", "963456789", "964567890", "965678901", "966789012",
"967890123", "968901234", "969012345", "970123456", "971234567",
"972345678", "973456789", "974567890", "975678901", "976789012",
"977890123", "978901234", "979012345", "980123456", "981234567",
"982345678", "983456789", "984567890", "985678901", "986789012",
"987890123", "988901234", "989012345", "990123456", "991234567",
"992345678", "993456789", "994567890", "995678901", "996789012",
"997890123", "998901234", "999012345", "900123456", "901234567",
"902345678", "903456789", "904567890", "905678901", "906789012",
"907890123", "908901234", "909012345", "910123456", "911234567",
"912345678", "913456789", "914567890", "915678901", "916789012",
"917890123", "918901234", "919012345", "920123456", "921234567",
"922345678", "923456789", "924567890", "925678901", "926789012",
"927890123", "928901234", "929012345", "930123456", "931234567",
"932345678", "933456789", "934567890", "935678901", "936789012"
]
root = Tk()
root.geometry("700x400")
root.resizable(0, 0)
root.config(bg="#103030")
root.title("Sorteio")
titulo = Label(text="Sorteio",
font=("Arial", "35", "bold"), bg="#103030", fg="#49e3e3")
titulo.place(relx=0.4, rely=0.05)
def limpar():
resultado_texto.config(text="")
def app():
def contagem_regressiva(contagem):
if contagem > 0:
resultado_texto.config(text=f"O Número vencedor aparece em {contagem} segundos.")
root.after(1000, contagem_regressiva, contagem - 1) # Chama novamente após 1 segundo
else:
numero_sorteado = random.choice(numeros_de_telefone)
resultado_texto.config(text=f"O número vencedor é : {numero_sorteado}")
# Começa a contagem regressiva de 5
contagem_regressiva(5)
but1 = Button(text="Sorteo", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=app)
but1.place(relx=0.1, rely=0.25, 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.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.4, relwidth=0.9, relheight=0.35)
root.mainloop()