Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
On the spot counter
#14
Unfortunately my tkinter code does not update the count automatically.
Can anyone advise?

Many thanks
Astrikor

Finally cracked it.
from tkinter import *
import time

root = Tk()
var = StringVar()
var.set('')
Label(root, textvariable = var).pack()
for i in range(15):
    Count = "Count ",str(i)
    time.sleep(1)
    var.set(Count)
    root.update()
This works ok.

Thanks guys!
Astrikor
Reply


Messages In This Thread
On the spot counter - by Astrikor - Nov-27-2019, 01:53 PM
RE: On the spot counter - by ThomasL - Nov-27-2019, 01:59 PM
RE: On the spot counter - by Larz60+ - Nov-27-2019, 04:26 PM
RE: On the spot counter - by Astrikor - Nov-27-2019, 06:47 PM
RE: On the spot counter - by snippsat - Nov-27-2019, 09:54 PM
RE: On the spot counter - by Astrikor - Nov-28-2019, 09:54 AM
RE: On the spot counter - by Astrikor - Nov-28-2019, 11:28 AM
RE: On the spot counter - by perfringo - Nov-28-2019, 01:23 PM
RE: On the spot counter - by Malt - Nov-28-2019, 11:29 AM
RE: On the spot counter - by Ray - Nov-27-2019, 10:49 PM
RE: On the spot counter - by ThomasL - Nov-28-2019, 06:18 AM
RE: On the spot counter - by Astrikor - Nov-29-2019, 08:22 AM
RE: On the spot counter - by Astrikor - Dec-02-2019, 10:13 AM
RE: On the spot counter - by Astrikor - Dec-04-2019, 08:38 AM

Forum Jump:

User Panel Messages

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