I was wondering how to change the label text after clicking a button. For example:
from Tkinter import *
import tkMessageBox
def onclick():
pass
root = Tk()
root.title("Pantai Hospital")
L1 = Label(root, text='Welcome to Pantai Hospital!')
L1.pack()
L2 = Label(root, text='Login')
L2.pack()
L3 = Label(root, text = "Username:")
L3.pack( side = LEFT, padx = 5, pady = 10)
username = StringVar()
E1 = Entry(root, textvariable = username, width = 40)
E1.pack ( side = LEFT)
L4 = Label(root, text = "Password:")
L4.pack( side = LEFT, padx = 5, pady = 10)
password = StringVar()
E2 = Entry(root, textvariable = password, show = "*", width = 40)
E2.pack( side = LEFT)'`
I want to change those labels username
and password
and the entry field into another different label after clicking a button. How do I do that?
print("something")
) on pressing a button? 2. how to change label text? – Pruritus