Tkinter Update intvar in label
<p>I am trying to have an integer to constantly change inside a label using Tkinter.</p>

<pre><code>import tkinter
root = tkinter.Tk()
var  = tkinter.IntVar()

label  = tkinter.Label(root, textvariable=var)
button = tkinter.Button(root, command=lambda: var.set(var.get() + 1), text='+1')

label.pack()
button.pack()
root.mainloop()
</code></pre>

<p>The closest I have come to what I need after searching is to the example above. However you need to click a button for the integer to change, What I need is without anything for the user to do, for the integer to change.</p>

<p>I have an array which is constantly getting bigger while the program is running which I need to print its length each time there is one new element appended to it.</p>

<p>Update: Working answer:</p>

<pre><code>import tkinter
import time
root = tkinter.Tk()
var  = tkinter.IntVar()

label  = tkinter.Label(root, textvariable=var)
label.pack()
def update_Value():
    for i in range(5):
        time.sleep(1)
        var.set(i)
        root.update()
root.after(0, update_Value)
root.mainloop()
</code></pre>