I am trying to configure the button based on the value of turn which is determined by the while loop which is determined by the value of game_over
The while loop is interfering with the main loop of tkinter. I can't seem to figure out a way around this.
This is the code.
from tkinter import *
connect = Toplevel()
col1 = Button(connect, width=10, height=4, text=" ")
col1.grid(row=0, column=1)
game_over = False
turn = 0
while not game_over:
if turn == 0:
col1.configure(bg="#FE6869")
x=input("Enter something")
if x=="yes":
game_over=True
else:
continue
else:
col1.configure(bg="#FFFC82")
x=input("Enter something")
if x=="no":
game_over=True
else:
continue
turn += 1
turn = turn % 2
connect.mainloop()
mainloopfrom being able to update the display.