Tkinter Label managing text by StringVar to update using user input by using get() & set() methods

preview_player
Показать описание

We can use string variable StringVar to change or mange the text of the Label in Tkinter GUI window.
We can assign text to StringVar by using set() method. Similarly we can read the value by using get() method.
We will use one button with command option connected to lambda to set the StringVar to a new string.
Рекомендации по теме
Комментарии
Автор

Thanks. I need to change the text of my label upon pushing the button. I found good explanation what to do in Tkinter.

UAtubeviewer
Автор

This video was a godsend to find, really helped me figure out how to update labels

jeckaltheinsane
Автор

Good video man, I need a way to create 1 text of 2 colors where one of those parts can be dynamic while the other is static

that is: Amount: 10

where "Amount" is fixed in black and "10" is red and when an operation is performed, for example, if it is subtracted and it becomes 9 then it remains intact in color red, do you know how to do it?

thank you :)

MrCat
Автор

Hi!. Thanks for your videos. Is it possible to assign the result of os.walk() to a label and loop through using the label to display the result on the window instead of using print()? Thanks in advance

ndas_adriana
Автор

Sir should we change the text color of certain words in label widget??

siblings_kitchen