Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- root = Tk()
- def refresh_window():
- # Redraw the window
- window.update()
- window.update_idletasks()
- print("Refresh completed.")
- # Create the main window
- window = root
- window.geometry("300x300")
- window.title("PythonExamples.org")
- label = Label(window, text="Click the below button to refresh the window.")
- label.pack()
- button = Button(window, text="Refresh", command=refresh_window)
- button.pack()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement