def check(event):
L = login.get()
P = password.get()
if L and P:
messagebox.showinfo('Success', 'Вы успешно вошли!')
if not L and P:
messagebox.showerror('Error 0x1', 'Введите логин!')
elif not P and L:
messagebox.showerror('Error 0x1', 'Введите пороль')
if not L and P:
messagebox.showerror('Error 1x1', 'Введите данные!')