Python Forum
[Tkinter] Trying to display a changing variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Trying to display a changing variable
#1
I have been trying to create a tkinter display of a variable that changes semi-regularly, but I cannot seem to get it to update regardless of what I try.
I have tried config(), StringVar(), and global.
#removed code and comments

from tkinter import ttk
root = Tk()
L = Label(root, justify = LEFT)
L.pack()
V = StringVar()
L['textvariable'] = V
V.set('Test')

#more removed code used for defining Lvar

def function():
    if condition True:

        #code for defining Lvar and X (wait time) removed to not have over 200 lines listed

        V.set(Lvar)
        #L.config(text = '{}'.format(Vortoj))
        root.after(X, function)

function()
root.mainloop()
Reply


Messages In This Thread
Trying to display a changing variable - by AnonymousNobody - Aug-06-2017, 04:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Trying to display a variable in a label Jordansonatina 2 18,161 Oct-31-2019, 06:28 PM
Last Post: Jordansonatina
  Display and update the label text which display the serial value jenkins43 5 9,323 Feb-04-2019, 04:36 AM
Last Post: Larz60+
  Display more than one button in GUI to display MPU6000 Sensor readings barry76 4 4,068 Jan-05-2019, 01:48 PM
Last Post: wuf

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020