anyone know why my tkinter is glitching out like this after around 2.5 minutes?
this code is the minimum example so it wont have the coloured cells but it is the same problem
from tkinter import *
import random
tk = Tk()
tk.wm_title("Battleship")
# forming tkinter window
def baseGrid():
tk.player_canvas = Canvas(tk, height=300, width=300, highlightbackground='black', highlightthickness=0.5)
tk.ai_canvas = Canvas(tk, height=300, width=300, highlightbackground='black', highlightthickness=0.5)
tk.player_canvas.grid(row=1, column=0, padx=50)
tk.ai_canvas.grid(row=1, column=1, padx=50)
for x in range(10):
for y in range(10):
tk.player_canvas.create_rectangle(x * 30, y * 30, 300, 300, fill='white')
tk.ai_canvas.create_rectangle(x * 30, y * 30, 300, 300, fill='white')
while True:
tk.update()
tk.update_idletasks()
place = baseGrid()