class movingpicsafter(movingpics)def domoves(selfdelayobjectidincrxreptxincryrepty)if reptxself canvas move(objectidincrx reptx - elseself canvas move(objectid incryrepty - if not (reptx or repty)self moving remove(objectidelseself canvas after(delayself domovesdelayobjectidincrxreptxincryreptydef onmove(selfevent)traceevent('onmove'event object self object move cur obj to click spot if objectmsecs int(pickdelays[ parms 'delay=% msecunits=% (msecspickunits[ ]self settextinfo(parmsself moving append(objectincrxreptxincryrepty self plotmoves(eventself domoves(msecsobjectincrxreptxincryreptyself where event if __name__ ='__main__'from sys import argv if len(argv= import movingpics movingpics picdir argv[ root tk(movingpicsafter(rootroot mainloop(when this file is executed not this module' global and fromdoesn' link names to appreciate its operationopen this script' window full screen and create some objects in its canvas by pressing "pafter an initial click to insert picturesdragging out shapesand so on nowwhile one or more moves are in progressyou can start another by middle-clicking on another object and right-clicking on the spot to which you want it to move it starts its journey immediatelyeven if other objects are in motion each object' scheduled after events are added to the same event loop queue and dispatched by tkinter as soon as possible after timer expiration if you run this subclass module directlyyou might notice that movement isn' quite as fast or as smooth as in the original (depending on your machineand the many layers of software under python)but multiple moves can overlap in time example - shows how to achieve such parallelism with threads this process worksbut as we learned in and updating guis in spawned threads is generally dangerous affair on one of my machinesthe movement that this script implements with threads was bit jerkier than the original version--perhaps pydrawpainting and moving graphics