I was making login system and if they use incorrect password or username and if they left the input field empty it should say error in order to do that I use get attribute but it's saying object has no attribute get so what should I do?
from tkinter import *
from PIL import ImageTk
from tkinter import messagebox
class Login():
def __init__(self, root):
self.root = root
self.root.title("Login system")
self.root.geometry("1920x1080")
#background img
self.bg=ImageTk.PhotoImage(file="Image/1.jpg")
self.bg_image=Label(self.root, image=self.bg).place(x=0, y=0, relwidth=1, relheight=1)
#login page
FrameLogin = Frame(self.root, bg="White")
FrameLogin.place(x=390, y=150, width=500, height=488)
#LoginTitle
title=Label(FrameLogin, text="Login Here", font=("Impact", 35, "bold"), fg="#850101", bg="white").place(x=130, y=30)
#Username
UserUserName=Label(FrameLogin, text="Username", font=("Impact", 15), fg="black", bg="white").place(x=70, y=160)
self.UserName=Entry(FrameLogin, font=("Goudy old style", 15), fg="grey", bg="white").place(x=70, y=190, width=320, height=35)
#Password
UserPassword=Label(FrameLogin, text="Password", font=("Impact", 15,), fg="black", bg="white").place(x=70, y=230)
self.Password=Entry(FrameLogin, font=("Goudy old style", 15), fg="grey", bg="white").place(x=70, y=260, width=320, height=35)
#ForgetButton
ForgetButton = Button(FrameLogin, text="Forget Password", bd=0, font=("Goudy old style", 10), fg="blue", bg="white").place(x=70, y=310)
#LoginButton
LoginButton = Button(FrameLogin, command=self.checker, cursor="hand2", text="Login", bd=0, font=("Impact", 20), fg="white", bg="#850101").place(x=120, y=350, width=230, height= 37)
def checker(self):
if self.UserName.get() == "" or self.Password.get() == "":
messagebox.showerror("Error", "Input required", parent=self.root)
elif self.UserName.get() != "Abemelek" or self.Password.get() != "1234":
messagebox.showerror("Eror", "Username or password incorrect", parent=self.root)
elif self.UserName.get() == "Abemelek" or self.Password.get() == "1234":
messagebox("Welcome", f"Welcome {self.UserName.get()}")
root = Tk()
obj = Login(root)
root.mainloop()