Чтобы изменить размер — нажмите левую кнопку мыши и двигайте вправо, чтобы увеличить длину хвоста и влево.
from tkinter import * from random import randrange as rnd import time root = Tk() root.geometry('800x600') canv = Canvas(root,bg='lightblue') canv.pack(fill = BOTH, expand = 1) colors = ['lightyellow', 'lightgray', 'gray', 'pink', 'violet', 'brown', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'magenta', 'black', 'gray', 'lightgreen'] tail = [] tail_size = 30 dr = 2 def clear(event): canv.delete(ALL) def resize_start(event): global start_x start_x = event.x def resize_end(event): global tail_size tail_size += (event.x - start_x) // 10 tail_size = max(tail_size,1) print (tail_size) def paint(event): global tail x = event.x y = event.y tail += [(x,y)] tail = tail[-tail_size:] dr = 50 / tail_size r = 2 clear(0) for t in tail: x = t[0] y = t[1] r += dr canv.create_oval(x-r//2,y-r//2,x+r//2,y+r//2,fill = 'yellow', width=0) canv.bind('<Motion>',paint) canv.bind('<Button-1>',resize_start) canv.bind('<ButtonRelease>',resize_end) mainloop()