I'm learning Python and I decided to make a GUI. It's a simple GUI that'll just move a polygon on the screen. But it seems the thread keep getting stuck in the update
method.
class main():
render = Render(500, 500)
while True:
render.update()
time.sleep(1)
class Render:
def __init__(self, width, height):
self.window = Tk()
self.window.config(height=500, width=500)
self.canvas = Canvas(self.window, width = width, height = height,
background = "white")
self.deltaX = 0
def update(self):
print(self.deltaX)
self.canvas.create_polygon(150 + self.deltaX, 75, 225 + self.deltaX, 0,
300 + self.deltaX, 75, 225 + self.deltaX, 150,
outline = "black", fill = "")
self.canvas.pack()
self.window = mainloop()
self.deltaX += 10
return None
Sorry if this is dumb, but I'm very new to Python.