Dec-28-2021, 11:42 AM
I try to make a simple program. Up button count the number and show the result on screen. Same with the down button. My problem is that my program count them in the background and shows only the last result (1000). Any idea how to say to my program "On every step show the new number in label"
from tkinter import * root = Tk() number = 0 label = Label (root, text=number).grid(row=0, column =1) def up(): number = 0 while number < 1000: number = number + 1 print (number) label = Label (root, text=number).grid(row=0, column =1) button1 = Button(root, text="UP", command=up) button2 = Button(root, text="DOWN") button3 = Button(root, text="QUIT", command=quit) button1.grid(row=1, column=0) button2.grid(row=1, column=1) button3.grid(row=1, column=2) root.mainloop()