Mensagens

A mostrar mensagens de dezembro, 2025

Feliz Ano Novo 2026

from datetime import datetime banner = r""" ______ _ _ _ ___ ___ ___ __ | ____| | (_) /\ | | |__ \ / _ \__ \ / / | |__ ___| |_ ____ / \ _ __ ___ __| | ___ ) | | | | ) / /_ | __/ _ \ | |_ / / /\ \ | '_ \ / _ \ / _` |/ _ \ / /| | | |/ / '_ \ | | | __/ | |/ / / ____ \| | | | (_) | | (_| | __/ / /_| |_| / /| (_) | |_| \___|_|_/___| /_/ \_\_| |_|\___/ \__,_|\___| |____|\___/____\___/ """ agora = datetime.now() # Verifica se é 1º de janeiro if agora.month == 1 and agora.day == 1 : print (banner) print ( " 🎆 FELIZ ANO NOVO! 🎆 " )

Feliz Ano Novo 2026

banner = r""" ______ _ _ _ ___ ___ ___ __ | ____| | (_) /\ | | |__ \ / _ \__ \ / / | |__ ___| |_ ____ / \ _ __ ___ __| | ___ ) | | | | ) / /_ | __/ _ \ | |_ / / /\ \ | '_ \ / _ \ / _` |/ _ \ / /| | | |/ / '_ \ | | | __/ | |/ / / ____ \| | | | (_) | | (_| | __/ / /_| |_| / /| (_) | |_| \___|_|_/___| /_/ \_\_| |_|\___/ \__,_|\___| |____|\___/____\___/ """ print (banner)

Odd fracionária

from tkinter import * root = Tk() root.geometry( "600x500" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Odd fracionária" ) titulo = Label( text = "Odd fracionária" , font =( "Arial" , "28" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.25 , rely = 0.05 ) texto_sub1 = Label( text = "Probabilidade de perder:" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.05 , rely = 0.25 ) texto_sub2 = Label( text = "Probabilidade de ganhar:" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub2.place( relx = 0.05 , rely = 0.4 ) # ------------------ ENTRADAS ------------------ Probabilidade_perder = StringVar() Probabil...

Feliz Ano Novo 2026

from tkinter import * from datetime import datetime def atualizar_contagem (): agora = datetime.now() diferenca = data_alvo - agora if diferenca.total_seconds() <= 0 : contagem_label.config( text = " Feliz Ano Novo 2026!" , font =( "Arial" , 30 , "bold" ) , fg = "#ffdd00" ) else : dias = diferenca.days horas , resto = divmod (diferenca.seconds , 3600 ) minutos , segundos = divmod (resto , 60 ) if dias > 0 : texto = f" { dias } dias \n{ horas : 02d } horas : { minutos : 02d } minutos : { segundos : 02d } segundos" else : texto = f" { horas : 02d } horas : { minutos : 02d } minutos : { segundos : 02d } segundos" contagem_label.config( text =texto , font =( "Arial" , 28 , "bold" ) , fg = "#49e3e3" ) root.after( 1000 , atualizar_contagem) root = Tk() root.geometry( "700x400" )...

Piores Selecções por continente

from tkinter import * piores_selecoes = { "AFC" : { "selecao" : "Timor-Leste" , "posicao" : 198 , "pontuacao" : 835.55 } , "CAF" : { "selecao" : "Somália" , "posicao" : 200 , "pontuacao" : 827.07 } , "CONCACAF" : { "selecao" : "Anguilla" , "posicao" : 209 , "pontuacao" : 759.78 } , "CONMEBOL" : { "selecao" : "Bolívia" , "posicao" : 76 , "pontuacao" : 1329.56 } , "OFC" : { "selecao" : "Cook Islands" , "posicao" : 186 , "pontuacao" : 877.53 } , "UEFA" : { "selecao" : "San Marino" , "posicao" : 210 , "pontuacao...

Palavras que estão na lista

from tkinter import * palavras = [ "maçã" , "banana" , "laranja" , "uva" , "abacaxi" ] root = Tk() root.geometry( "600x300" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Palavras que estão na lista" ) # Título titulo = Label( text = "Palavras que estão na lista" , font =( "Arial" , 28 , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.1 , rely = 0.05 ) # Subtítulo texto_sub1 = Label( text = "Escreva a palavra:" , font =( "Arial" , 18 , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.05 , rely = 0.32 ) # Entrada palavra = StringVar() palavra_entrada = Entry( textvariable =palavra , font =( "Arial" , 12 , "bold" ) , bg = "white" , fg = ...

Feliz Natal

import time i = 0 while i < 5 : print ( "HO" , end = ' ' ) time.sleep( 1 ) i += 1 time.sleep( 1 ) print ( "Feliz" , end = ' ' ) time.sleep( 1 ) print ( "Natal!!" )

Fases da Lua

from tkinter import * import ephem from datetime import datetime def validar_data (data_str): try : data = datetime.strptime(data_str , "%Y/%m/%d" ) return data except ValueError as e: erro = str (e) if "does not match format" in erro: return " ⚠️ Formato inválido! Use YYYY/MM/DD." elif "month must be in" in erro: return " ⚠️ Mês inválido! Deve ser entre 01 e 12." elif "day is out of range" in erro: return " ⚠️ Dia inválido para o mês informado." else : return " ⚠️ Data inválida!" # ------------------------------- # Função principal # ------------------------------- def app (): data_str = Data.get() validacao = validar_data(data_str) if isinstance (validacao , str ): # mensagem de erro resultado_texto.config( text =validacao) return try : lua = ephem.Mo...

Bem-vindo ao Jogo Roda da Sorte

from tkinter import * import random root = Tk() root.geometry( "700x300" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Roda da Sorte" ) codigos_validos = [ "1111" , "2222" , "3333" , "4444" , "5555" ] def voltar_login (): for widget in root.winfo_children(): widget.destroy() criar_tela_login() def verificar_codigo (): codigo_digitado = entrada_codigo.get() if codigo_digitado in codigos_validos: codigos_validos.remove(codigo_digitado) # elimina código frame_login.destroy() mostrar_jogo() else : msg_erro.config( text = "Código inválido ou já usado! ❌ " , fg = "red" ) def criar_tela_login (): global entrada_codigo , msg_erro , frame_login frame_login = Frame(root , bg = "#103030" ) frame_login.place( relx = 0 , rely = 0 , relwidth = 1 , relheight = 1 ) ...

Calcular Combustível Barco

from tkinter import * root = Tk() root.geometry( "700x700" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Calcular Combustível Barco" ) # Título titulo = Label( text = "Calcular Combustível Barco" , font =( "Arial" , "28" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.18 , rely = 0.05 ) # Labels texto_sub1 = Label( text = "Distância da viagem (milhas náuticas):" , font =( "Arial" , "15" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.05 , rely = 0.15 ) texto_sub2 = Label( text = "Velocidade média (nós):" , font =( "Arial" , "15" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub2.place( relx = 0.23 , rely = 0.25 ) texto_sub3 = Label( text = "Consu...