| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 | import tkinterfrom tkinter import messageboxclass MyGUI:    def __init__(self):        # Создать виджет главного окна        self.main_window = tkinter.Tk()        # self.label1 = tkinter.Label(self.main_window, text='Hello world',         #                             borderwidth=1, relief='solid')                # self.label2 = tkinter.Label(self.main_window, text='This is my GUI',        #                             borderwidth=4, relief='raised')                # self.label1.pack(ipadx=20, ipady=20)        # self.label2.pack(ipadx=20, ipady=20)        self.my_button = tkinter.Button(self.main_window, text='Нажми меня',                                        command=self.do_something)        self.quit_button = tkinter.Button(self.main_window, text='Exit',                                          command=self.main_window.destroy)        self.my_button.pack()        self.quit_button.pack()        # Показать заголовок        self.main_window.title('Мой первый GUI')        # Войти в главный цикл tkinter        tkinter.mainloop()    def do_something(self):        messagebox.showinfo(title=None, message='my message!')    def main():    my_gui = MyGUI()    # print(tkinter.__dict__)    # help(tkinter)if __name__ == '__main__':    main()
 |