user interface - (Python GUI)Two instructions are ignored when following a hexagon -
when run code, [ tkuptake(0,-5,-5) tkuptake(0, 5,-5) ] ignored when following hexagon. problem?
import time tkinter import * tk = tk() canvas = canvas(tk, width=1000, height=1000, background="black") canvas.pack() canvas.create_polygon(300, 200, 300, 250, 340, 225, fill="yellow") def tkuptake(x, y, z): in range(0, 20): canvas.move(x, y, z) tk.update() time.sleep(0.03) k = int(input("input value\n")) q in range(0, k): tkuptake(1, 5, 0) tkuptake(1, 5, 5) tkuptake(1,-5, 5) tkuptake(1,-5, 0) tkuptake(0,-5,-5) tkuptake(0, 5,-5)
Comments
Post a Comment