Key action: set Label text : Key Action « Event « Python
- Python
- Event
- Key Action
Key action: set Label text

import Tkinter
root = Tkinter.Tk()
tv = Tkinter.StringVar()
Tkinter.Label(textvariable=tv).pack()
Tkinter.Entry(textvariable=tv).pack()
tv.set('Welcome!')
Tkinter.Button(text="Exit", command=root.quit).pack()
Tkinter.mainloop()
print tv.get()
Related examples in the same category