Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python tkinter change label text

from tkinter import *

root = Tk()
root.title('Test')


def change_text():
    print(my_label)
    my_label.config(text='new text')
    my_label.grid(row=0, column=0)


# create
my_label = Label(root, text='Hello World')
my_button = Button(root, text='click me', command=change_text, bg='#FFFF00')

# draw
my_label.grid()
my_button.grid()

# run
root.mainloop()
Comment

label change in tkinter

stud_input=StringVar()
stud_input.set("Label")
lbl3=Label(add_image_frame,textvariable=stud_input,bg="#ED6244",fg="black").grid(row=4,column=0)
stud_input.set("Changed Label")
Comment

How to get the Tkinter Label text

l = tk.Label(text="hello, world")
...
print("the label is", l.cget("text"))
Comment

PREVIOUS NEXT
Code Example
Python :: scroll to bottom in selenium python 
Python :: number of rows or columns in numpy ndarray python 
Python :: radix sort python 
Python :: place a widget in a specific position in tkinter 
Python :: run py file in another py file 
Python :: rotation points space python 
Python :: how to create a cube in ursina 
Python :: knn plot the clusters 
Python :: payizone 
Python :: pandas dataframe from multiple csv 
Python :: python get ip info 
Python :: import py to exe 
Python :: .annotate unique distinct 
Python :: save np array as mat file 
Python :: sort by column dataframe pyspark 
Python :: python psycopg2 utf8 
Python :: How to efficiently create a median finder for a stream of values, in Python? 
Python :: Can only use .str accessor with string values! 
Python :: python stack class 
Python :: how to know if a input is a interger in python 
Python :: print decimal formatting in python 
Python :: show image with ratio opencv python 
Python :: how to use tensorboard 
Python :: how to factorise an expression in python 
Python :: how to get the index of a value in pandas dataframe 
Python :: dataframe catch data types 
Python :: python replace regex 
Python :: python imread multiple images 
Python :: utc to local time python 
Python :: when pyspark 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =