Start New Discussion within our Software Development Community
from Tkinter import *

root = Tk()

button = Button(text="Push me", command=toggle)
button.pack()

label = Label(text="Hello")
label.pack()

def toggle():
    if label.winfo_ismapped():
        button['text']='unmap'
        label.pack_forget()
    else:
        button['text']='map'
        label.pack()

root.wait_window()

Specialties:
IT/Science/Contracts/Religious translation/interpreting FIN-ENG-FIN
Python programming

def should go in beginning, sorry.

from Tkinter import *
def toggle():
    if label.winfo_ismapped():
        button['text']='unmap'
        label.pack_forget()
    else:
        button['text']='map'
        label.pack()

root = Tk()

button = Button(text="Push me", command=toggle)
button.pack()

label = Label(text="Hello")
label.pack()

root.wait_window()
The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.