My code should create a window and then count from 1 to 10 but, it makes a window and only counts from 1 to 10 when you close the window. how do I make it count when the window pops up, not when it closes?
from tkinter import Tk, mainloop import time I = 1 window = Tk() window.title("Game") window.configure(width=500, height=300) window.configure(bg='blue') window.geometry("+" + str(I * 5) + "+0") window.mainloop() while I < 10: print(I) print("Hi") I += 1 time.sleep(0.2)