Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Update label text after pressing a button in Tkinter

#tested and working on PYTHON 3.8 AND ADDED TO PATH
import tkinter as tk
win = tk.Tk()

def changetext():
	a.config(text="changed text!")
    
a = tk.Label(win, text="hello world")
a.pack()
tk.Button(win, text="Change Label Text", command=changetext).pack()

win.mainloop()
Comment

PREVIOUS NEXT
Code Example
Python :: numpy print options 
Python :: how to delete records in pandas before a certain date 
Python :: convert excel to csv using python 
Python :: python text fromatting rows 
Python :: dataframe delete row 
Python :: jupyter notebook set default directory 
Python :: get max value column pandas 
Python :: check django version 
Python :: how to find second maximum element of an array python 
Python :: timed loop python 
Python :: find nth root of m using python 
Python :: Add a quit button Tkinter 
Python :: python numpy kurtosis 
Python :: add font to the label in window tkinter 
Python :: nlargest hierarchy series pandas 
Python :: say command python 
Python :: how to check if mouse is over a rect in pygame 
Python :: exit all threads from within a thread python 
Python :: how to import matplotlib.pyplo in python 
Python :: blender python save file 
Python :: how to make a kivy label multiline text 
Python :: remove blank spaces from a list python 
Python :: zlib decompress python 
Python :: package for downloading from youtybe for python 
Python :: how to get discord username nextcord interactions 
Python :: get file names in folder python 
Python :: swapcase 
Python :: pandas.core.series.series to dataframe 
Python :: pyqt5 line edit password input 
Python :: convert video to text python 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =