import tkinter as tk
from tkinter import messagebox, simpledialog
PASSWORD = "1234"
LOVE_MESSAGE = """
❤️ My Love ❤️
You are one of the most beautiful parts of my life.
Every time I see you,
I can't help but smile.
Thank you for being you. ❤️
Forever in my heart.
"""
def open_heart():
password = simpledialog.askstring(
"Secret ❤️",
"Enter the password:",
show="*"
)
if password is None:
return
if password == PASSWORD:
messagebox.showinfo(
"❤️ Secret Message ❤️",
LOVE_MESSAGE
)
else:
messagebox.showerror(
"Wrong Password",
"Wrong password! Try again ❤️"
)
# Main window
root = tk.Tk()
root.title("❤️ Secret Heart ❤️")
root.geometry("500x500")
root.resizable(False, False)
title = tk.Label(
root,
text="There is a secret inside...",
font=("Arial", 22, "bold")
)
title.pack(pady=50)
# Heart button
heart_button = tk.Button(
root,
text="❤️",
font=("Arial", 100),
bd=0,
relief="flat",
command=open_heart,
cursor="hand2"
)
heart_button.pack()
hint = tk.Label(
root,
text="Click the heart ❤️",
font=("Arial", 16)
)
hint.pack(pady=30)
root.mainloop()