multiple threads--but againthis can vary example - pp \gui\movingpics\movingpics_threads py ""pydraw-threadsuse threads to move objectsworks okay on windows provided that canvas update(not called by threads (else exits with fatal errorssome objs start moving immediately after drawnetc )at least some canvas method calls must be thread safe in tkinterthis is less smooth than time sleepand is dangerous in generalthreads are best coded to update global varsnot change gui""import _thread as threadtimesysrandom from tkinter import tkmainloop from movingpics import movingpicspickunitspickdelays class movingpicsthreaded(movingpics)def __init__(selfparent=none)movingpics __init__(selfparentself mutex thread allocate_lock(import sys #sys setcheckinterval( switch after each vm opdoesn' help def onmove(selfevent)object self object if object and object not in self movingmsecs int(pickdelays[ parms 'delay=% msecunits=% (msecspickunits[ ]self settextinfo(parms#self mutex acquire(self moving append(object#self mutex release(thread start_new_thread(self domove(objectevent)def domove(selfobjectevent)canvas event widget incrxreptxincryrepty self plotmoves(eventfor in range(reptx)canvas move(objectincrx canvas update(time sleep(pickdelays[ ]this can change for in range(repty)canvas move(object incrycanvas update(update runs other ops time sleep(pickdelays[ ]sleep until next move #self mutex acquire(self moving remove(objectif self object =objectself where event #self mutex release(if __name__ ='__main__'root tk( complete gui programs