import tkinter as tk def ラベル表示(): ラベル.configure(text="こんにちわ") root = tk.Tk() root.geometry("200x100") ラベル = tk.Label(text="ラベル") ボタン = tk.Button(text="押す", command = ラベル表示) ラベル.pack() ボタン.pack() root.mainloop()