# -*- coding: utf-8 -*- import tkinter as tk root = tk.Tk() root.title("tk5.py") root.geometry("100x100") ##################################### lbText = tk.StringVar() def hello(): lbText.set("Hello!") btn = tk.Button(root, text = "Hello", \ borderwidth = 10, bg = '#0000ff', \ fg = 'yellow', command = hello) lb = tk.Label(root, textvariable = lbText, fg = 'darkgreen') btn.pack() lb.pack() ##################################### root.mainloop()