Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.89 KB

File metadata and controls

56 lines (38 loc) · 1.89 KB

App de Quotes Aleatorios con Python y CustomTkinter

Aplicación sencilla hecha para practicar Python. Muestra frases aleatorias al presionar un botón.

🖥️ Características

  • Interfaz hecha con CustomTkinter.
  • Botón para generar una frase al azar.
  • Lista de quotes personalizables.

🚀 Cómo usar

  1. Ejecuta el script.
  2. Presiona Get a quote.
  3. La app mostrará una frase aleatoria.

📦 Requisitos

pip install customtkinter

📚 Código principal

import random
import customtkinter as ctk

quote_msg = ['See you later, alligator!', 'After a while, crocodile.', 'Stay out of trouble.', 'I’m out of here.', 'Yamete, onii-chan~. UwU', 'Okay...bye, fry guy!', 'Peace out!', 'Peace out, bitch!', 'Gotta get going.', 'Out to the door, dinosaur.', "Don't forget to come back!", 'Smell ya later!', 'In a while, crocodile.', 'Adios, amigo.', 'Begone!', 'Arrivederci.', 'Never look back!', 'So long, sucker!', 'Au revoir!', 'Later, skater!', "That'll do pig. That'll do.", 'Happy trails!', 'Smell ya later!', 'See you soon, baboon!', 'Bye Felicia!', 'Sayonara!', 'Ciao!', 'Well.... bye.', 'Delete your browser history!', 'See you, Space Cowboy!', 'Change da world. My final message. Goodbye.', 'Find out on the next episode of Dragonball Z...', 'Choose wisely!']

def getQuote():
    try:
        quote = random.choice(quote_msg)
        label_result.configure(text=f"Quote: '{quote}'")
    except:
        label_result.configure(text="Not quotes")

ctk.set_appearance_mode("dark-green")
app = ctk.CTk()
app.geometry("500x300")
app.title("App quotes")

my_font = ctk.CTkFont(family="Times New Roman", size=20, weight="bold")

label_result = ctk.CTkLabel(app, text="Quote:", font=my_font)
label_result.pack(pady=20)

btn = ctk.CTkButton(app, text="Get a quote", font=my_font, command=getQuote)
btn.pack(pady=20)

app.mainloop()

📄 Licencia

Libre para usar y modificar.