Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Danil\AppData\Local\Programs\Python\Python38\lib\tkinter\__init
__.py", line 1892, in __call__
return self.func(*args)
File "tt.py", line 12, in btn_click
messagebox.showinfo(title= 'Название', message=info_str)
NameError: name 'messagebox' is not defined
from tkinter import*
root = Tk()
def btn_click():
login = loginInput.get()
password = passField.get()
info_str = f'Данные : {str(login)}, {str (password)}'
messagebox.showinfo(title= 'Название', message=info_str)
# ошибка
# messagebox.showerror(title='', message='!!!Ошибка!!!' )
root['bg'] = '#fafafa'
root.title ('Название программы')
root.wm_attributes('-alpha', 1)
root.geometry('700x600')
root.iconbitmap('C:/Users/Danil/Desktop/armchair-icon.ico')
root.resizable(width=True , height=True)
canvas = Canvas(root, height=700, width=600)
canvas.pack()
frame = Frame(root, bg='green')
frame.place(relx=0.15, rely=0.15, relwidth=0.7 , relheight=0.7 )
titel = Label(frame, text='Logerpod', bg='gray', font=40)
titel.pack()
btn= Button(frame, text='Кнопка', bg= 'blue' , command =btn_click )
btn.pack()
loginInput = Entry(frame, bg= 'white')
loginInput.pack()
passField = Entry(frame, bg= 'white', show='*')
passField.pack()
root.mainloop()