Mensagens

A mostrar mensagens de março, 2025

Teste de Personalidade Mais Preciso do Mundo (Feliz dia da Mentira)

from tkinter import * import random root = Tk() root.geometry( "800x500" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Teste de Personalidade Mais Preciso do Mundo" ) titulo = Label( text = "Teste de Personalidade Mais Preciso do Mundo" , font =( "Arial" , "22" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.05 , rely = 0.05 ) resultados = [ "Você é 90% alienígena e tem poderes telepáticos escondidos!" , "Seu espírito animal é uma torradeira. \n Aqueces corações... e pães." , "Foi um pirata na vida passada e \n ainda tem sede de aventura !️ " , "Parabéns!É oficialmente um mago \n da procrastinação." , "É feito de 42% café e 58% caos." , "Na verdade, você é um robô e nunca percebeu." , "Tem 87% de chance de ser o próximo bilionário... \n ou não...

Momento de Inércia

from tkinter import * # Criar a janela principal root = Tk() root.geometry( "500x400" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Momento de Inércia" ) # Título titulo = Label( text = "Momento de Inércia" , font =( "Arial" , "28" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.15 , rely = 0.05 ) # Labels de entrada texto_sub1 = Label( text = "Massa (em kg):" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.18 , rely = 0.25 ) texto_sub2 = Label( text = "Distância ao eixo (m):" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub2.place( relx = 0.05 , rely = 0.45 ) # Entradas Massa = StringVar() Massa_entr...

Validar CPF

from tkinter import * root = Tk() root.geometry( "500x300" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Validar CPF" ) titulo = Label(root , text = "Validar CPF" , font =( "Arial" , 28 , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.25 , rely = 0.05 ) texto_sub1 = Label(root , text = "CPF para ser validado:" , font =( "Arial" , 18 , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.05 , rely = 0.3 ) CPF = StringVar() CPF_entrada = Entry(root , textvariable =CPF , font =( "Arial" , 12 , "bold" ) , bg = "white" , fg = "blue" , justify = 'center' ) CPF_entrada.place( relx = 0.6 , rely = 0.31 , relwidth = 0.3 ) def calcular_digito (cpf , peso): soma = sum ( int (cpf[i]) * (peso - i) for i in range (peso - 1 )) resto = soma % 11 return 0...

Codificar uma string em Base64

from tkinter import * from tkinter import ttk import base64 class AppConverter(): def __init__ ( self ): self .root = Tk() self .janela() self .frames_da_janela() self .widgets_frame1() self .Menus() self .root.mainloop() def janela ( self ): self .root.title( "Codificar uma string em Base64" ) self .root.configure( background = '#1e3743' ) self .root.geometry( "400x250" ) self .root.resizable( 0 , 0 ) def frames_da_janela ( self ): self .frame_1 = Frame( self .root , bd = 4 , bg = '#dfe3ee' , highlightbackground = '#759fe6' , highlightthickness = 2 ) self .frame_1.place( relx = 0.02 , rely = 0.02 , relwidth = 0.96 , relheight = 0.96 ) def widgets_frame1 ( self ): self .abas = ttk.Notebook( self .frame_1) self .Codificar_desCodificar = Frame( self .abas) ...

Preço por kg

from tkinter import * root = Tk() root.geometry( "500x400" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Preço por kg" ) titulo = Label( text = "Preço por kg" , font =( "Arial" , "28" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.15 , rely = 0.05 ) texto_sub1 = Label( text = "Preço Total:" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.35 , rely = 0.2 ) texto_sub2 = Label( text = "Quantidade da embalagem:" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub2.place( relx = 0.05 , rely = 0.3 ) Preço_Total = StringVar() Preço_Total_entrada = Entry( textvariable =Preço_Total , ...

Converter para o alfabeto em formato NATO

from tkinter import * root = Tk() root.geometry( "700x300" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Converter para o alfabeto em formato NATO" ) nato_alphabet = { "A" : "Alfa" , "B" : "Bravo" , "C" : "Charlie" , "D" : "Delta" , "E" : "Echo" , "F" : "Foxtrot" , "G" : "Golf" , "H" : "Hotel" , "I" : "India" , "J" : "Juliet" , "K" : "Kilo" , "L" : "Lima" , "M" : "Mike" , "N" : "November" , "O" : "Oscar" , "P" : "Papa" , "Q" : "Quebec" , "R" : "Romeo" , "S" : "Sierra" , "T...