""similarbut with widget after(scheduled eventsnot time sleep loopsbecause these are scheduled eventsthis allows both ovals and rectangles to be moving at the _same_ time and does not require update calls to refresh the guithe motion gets wild if you press 'oor 'rwhile move in progressmultiple move updates start firing around the same time""from tkinter import import canvasdraw_tags class canvaseventsdemo(canvasdraw_tags canvaseventsdemo)def moveem(selftagmoremoves)(diffxdiffy)moremoves moremoves[ ]moremoves[ :self canvas move(tagdiffxdiffyif moremovesself canvas after( self moveemtagmoremovesdef moveinsquares(selftag)allmoves [(+ )( + )(- )( - ) self moveem(tagallmovesif __name__ ='__main__'canvaseventsdemo(mainloop(this version inherits the drawing customizations of the priorbut lets you make both ovals and rectangles move at the same time--drag out few ovals and rectanglesand then press "oand then "rright away to make this go in facttry pressing both keys few timesthe more you pressthe more the objects movebecause multiple scheduled events are firing and moving objects from wherever they happen to be positioned if you drag out new shape during moveit starts moving immediately as before using multiple time sleep loop threads running animations in threads can sometimes achieve the same effect as discussed earlierit can be dangerous to update the screen from spawned thread in generalbut it works in this example (on the test platform usedat leastexample - runs each animation task as an independent and parallel thread that iseach time you press the "oor "rkey to start an animationa new thread is spawned to do the work example - pp \gui\tour\canvasdraw_tags_thread py ""similarbut run time sleep loops in parallel with threadsnot after(events or single active time sleep loopbecause threads run in parallelthis also allows ovals and rectangles to be moving at the _same_ time and does not require update calls to refresh the guiin factcalling update(once made this crash badlythough some canvas calls must be thread safe or this wouldn' work at all"" tkinter tourpart