How can I refresh whole tkinter window by clicking on a button? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

How can I refresh whole tkinter window by clicking on a button?

from tkinter import * root = Tk() root.geometry ("660x625") def refresh () : # code goes here refresh_button= Button(root, text="Refresh",command =refresh,font='bold', width=6) refresh_button.pack(anchor=center)

19th Mar 2022, 2:37 PM
VSR [ DEV ]
VSR [ DEV ] - avatar
7 Answers
+ 2
Dan Priest Will try. Thanks
20th Mar 2022, 3:24 AM
VSR [ DEV ]
VSR [ DEV ] - avatar
+ 1
Pariket Thakur I don't use frame in my project so it will not work
19th Mar 2022, 3:05 PM
VSR [ DEV ]
VSR [ DEV ] - avatar
+ 1
Ion Kare On clicking upon button data will change without exiting the program. For example - You were asked to input some data then data will store in CSV file and by using Treeview of tkinter it can be display in the form of table in GUI form but it will not show the data after you entered something. You have to exit the program and run it again to show the data. By refresh button you will not need to exit the program.
19th Mar 2022, 3:43 PM
VSR [ DEV ]
VSR [ DEV ] - avatar
+ 1
You could kill the root and call it again. May not be the right way, but it will appear as a refresh.
20th Mar 2022, 3:12 AM
Dan Priest
Dan Priest - avatar
0
"python 3.x - Refresh a tkinter frame on button press - Stack Overflow" https://stackoverflow.com/questions/45064732/refresh-a-tkinter-frame-on-button-press Or "How do I refresh tkinter window totally in python with a refresh button - Stack Overflow" https://stackoverflow.com/questions/30507167/how-do-i-refresh-tkinter-window-totally-in-python-with-a-refresh-button
19th Mar 2022, 2:53 PM
Pariket Thakur
Pariket Thakur - avatar
0
What do you mean by refresh
19th Mar 2022, 3:15 PM
Ion Kare
Ion Kare - avatar
0
Use Window.update() feature
21st Mar 2022, 8:27 AM
Roshan Kumar Mishra
Roshan Kumar Mishra - avatar