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")
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")
how to update values in tkinter
import tkinter as tk win = tk.Tk() max_amount = 0 label1 = None #just so it is defined def fun(): global max_amount, label1 max_amount +=100 label1.configure(text='Balance :$' + str(max_amount)) btn = tk.Button(win,text = 'Change', command = fun) btn.grid() t1 =str(max_amount) label1 = tk.Label(win,text = 'Balance :$' + t1) label1.grid() win.mainloop()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us