from tkinter import *
from tkinter import messagebox
def login():
username = entry1.get()
password = entry2.get()
if username =='' and password=='':
messagebox.showerror('login', 'blanks are not allowed')
elif username =='optometryfans' and password== '12345':
messagebox.showerror('login', 'Login Successful')
root.destroy()
top =Tk()
top.configure(bg='white')
label4 = Label(top, text = 'Welcomme!', font=('areal', 30), bg='white')
label4.place(x=550, y=300)
else :
messagebox.showerror('login', 'Incorrect Login and Password')
root=Tk()
root.configure(bg='cyan4')
global entry1
global entry2
label1= Label(root, text ='Optometry Fans LogIn Page', bg='cyan3', fg='black', font=('areal', 20), bd=5)
label1.place(x=500, y=50)
label2= Label(root, text ='User Name :', bg='cyan4', fg='white', font=('areal', 21))
label2.place(x=405, y=150)
label3= Label(root, text ='Password :', bg='cyan4', fg='white', font=('areal', 21),)
label3.place(x=405, y=250)
entry1=Entry(root, font=('areal', 18))
entry1.place(x=600, y=160)
entry2=Entry(root, font=('areal', 18), show='*')
entry2.place(x=600, y=250)
button=Button(root, text='Click to Login', bg='cyan3', font=('areal', 15), bd=5, command=login)
button.place(x=600, y=350)
root.mainloop()
Most Famous Post
Friday, December 10, 2021
Saturday, December 11, 2021