from tkinter import *
from random import randrange as rnd
root = Tk()
root.geometry('1200x600')
canv = Canvas(root,bg='lightblue')
canv.pack(fill = BOTH, expand = 1)
tail = []
tail_size = 100
x = 0
y = 0
def move(event):
global x,y
x = event.x
y = event.y
canv.bind('<Motion>', move)
while 1:
tail += [(x,y)]
tail = tail[-tail_size:]
r = 2
canv.delete(ALL)
for t in tail:
x = t[0]
y = t[1]
r += 0.5
canv.create_oval(x-r//2,y-r//2,x+r//2,y+r//2,fill = 'yellow', width=0)
canv.update()
mainloop()
One thought on “Мышь оставляет след (без задержки)”