Code:
import tkinter as tk
from tkinter import messagebox
def login():
username = entry_username.get()
password = entry_password.get()
if username == "admin" and password == "12345":
messagebox.showinfo("Login Successful", "Welcome, admin!")
else:
messagebox.showerror("Login Failed", "Incorrect username or password!")
root = tk.Tk()
root.title("Login System")
root.geometry("300x200")
label_username = tk.Label(root, text="Username:")
label_username.pack(pady=5)
entry_username = tk.Entry(root)
entry_username.pack(pady=5)
label_password = tk.Label(root, text="Password:")
label_password.pack(pady=5)
entry_password = tk.Entry(root, show="*")
entry_password.pack(pady=5)
login_button = tk.Button(root, text="Login", command=login)
login_button.pack(pady=10)
root.mainloop()
On this page of the site you can watch the video online How to Make a Simple Login Program with Python with a duration of hours minute second in good quality, which was uploaded by the user Difa milkalia 02 December 2025, share the link with friends and acquaintances, this video has already been watched 5 times on youtube and it was liked by 0 viewers. Enjoy your viewing!