self kinds self create_oval_taggedself create_rectangle_tagged def create_oval_tagged(selfx )objectid self canvas create_oval( self canvas itemconfig(objectidtag='ovals'fill='blue'return objectid def create_rectangle_tagged(selfx )objectid self canvas create_rectangle( self canvas itemconfig(objectidtag='rectangles'fill='red'return objectid def onmoveovals(selfevent)print('moving ovals'self moveinsquares(tag='ovals'move all tagged ovals def onmoverectangles(selfevent)print('moving rectangles'self moveinsquares(tag='rectangles'def moveinsquares(selftag) reps of times per sec for in range( )for (diffxdiffyin [(+ )( + )(- )( - )]self canvas move(tagdiffxdiffyself canvas update(force screen redraw/update time sleep( pausebut don' block gui if __name__ ='__main__'canvaseventsdemo(mainloop(all three of the scripts in this section create window of blue ovals and red rectangles as you drag new shapes out with the left mouse button the drag-out implementation itself is inherited from the superclass right-mouse-button click still moves single shape immediatelyand double-left click still clears the canvastoo--other operations inherited from the original superclass in factall this new script really does is change the object creation calls to add tags and colors to drawn objects hereadd text field at the top of the canvasand add bindings and callbacks for motion requests figure - shows what this subclass' window looks like after dragging out few shapes to be animated the "oand "rkeys are set up to start animation of all the ovals and rectangles you've drawnrespectively pressing " ,for examplemakes all the blue ovals start moving synchronously objects are animated to mark out five squares around their location and to move four times per second new objects drawn while others are in motion start to movetoobecause they are tagged you need to run these live to get feel for the simple animations they implementof course (you could try moving this book back and forth and up and downbut it' not quite the sameand might look silly in public places tkinter tourpart