Ответ:
import tkinter as tk
from tkinter import messagebox
window = tk.Tk()
window.title("Пример приложения с кнопкой")
label = tk.Label(text="Hello world!")
label.pack()
def say_hello():
messagebox.showinfo("Ответ", "Hello Again!")
button = tk.Button(text="Привет", command=say_hello)
button.pack()
window.mainloop()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Ответ:
import tkinter as tk
from tkinter import messagebox
window = tk.Tk()
window.title("Пример приложения с кнопкой")
label = tk.Label(text="Hello world!")
label.pack()
def say_hello():
messagebox.showinfo("Ответ", "Hello Again!")
button = tk.Button(text="Привет", command=say_hello)
button.pack()
window.mainloop()