How to reload text in label?
How to refresh text in label?
How to reload label?
Code:
import tkinter as tk
Window = tk.Tk()
Window.geometry("250x200")
Window.wm_iconbitmap('NH.ico')
Window.title("Label Tutorial")
label = tk.Label(Window, text="Insert your text: ")
label.grid(row=0, column=0, pady=5, padx=5)
entry = tk.Entry(Window)
entry.grid(row=0, column=1, pady=5, padx=5)
label1 = tk.Label(Window, text="Your text")
label1.grid(row=1, pady=5, padx=5)
def label_reload():
upText = entry.get()
label1.configure(text=upText)
label1.after(400, label_reload)
label_reload()
button = tk.Button(Window, text="Close", command=exit)
button.grid(row=2, column=1) Window.mainloop()
#Python
#Tkinte
#Label
#Reload
#text #Refresh
Window = tk.Tk()
Window.geometry("250x200")
Window.wm_iconbitmap('NH.ico')
Window.title("Label Tutorial")
label = tk.Label(Window, text="Insert your text: ")
label.grid(row=0, column=0, pady=5, padx=5)
entry = tk.Entry(Window)
entry.grid(row=0, column=1, pady=5, padx=5)
label1 = tk.Label(Window, text="Your text")
label1.grid(row=1, pady=5, padx=5)
def label_reload():
upText = entry.get()
label1.configure(text=upText)
label1.after(400, label_reload)
label_reload()
button = tk.Button(Window, text="Close", command=exit)
button.grid(row=2, column=1) Window.mainloop()
#Python
#Tkinte
#Label
#Reload
#text #Refresh
No comments:
Post a Comment