KEMBAR78
Data Structure | PDF
0% found this document useful (0 votes)
3 views2 pages

Data Structure

This document contains a Python script that creates a simple user login interface using the Tkinter library. It includes fields for username and password input, a login button, and a 'Forget Password?' link. The script captures the input values but does not implement validation logic for the credentials.

Uploaded by

patnaan037
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Data Structure

This document contains a Python script that creates a simple user login interface using the Tkinter library. It includes fields for username and password input, a login button, and a 'Forget Password?' link. The script captures the input values but does not implement validation logic for the credentials.

Uploaded by

patnaan037
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

python

Copy

import tkinter as tk

def login():

username = username_entry.get()

password = password_entry.get()

# Here you would add your logic to validate the username and password

print(f"Username: {username}, Password: {password}")

window = tk.Tk()

window.title("User Login")

username_label = tk.Label(window, text="Username")

username_label.grid(row=0, column=0)

username_entry = tk.Entry(window)

username_entry.grid(row=0, column=1)

password_label = tk.Label(window, text="Password")

password_label.grid(row=1, column=0)

password_entry = tk.Entry(window, show="*")

password_entry.grid(row=1, column=1)
login_button = tk.Button(window, text="Login", command=login)

login_button.grid(row=2, column=0, columnspan=2)

forget_password_link = tk.Label(window, text="Forget Password?", fg="blue", cursor="hand2")

forget_password_link.grid(row=3, column=0, columnspan=2)

window.mainloop()

You might also like