recoding with classes and bound methods example - takes the model one small step further and migrates it to class to allow for future customization and reuse its operationwindowand output are the same as the prior non-object-oriented versionbut the queue is checked more oftenand there are no standard output prints notice how we use bound methods for button callbacks and thread actions herebecause bound methods retain both instance and methodthe threaded action has access to state informationincluding the shared queue this allows us to move the queue and the window itself from the prior version' global variables to instance object state example - pp \gui\tools\queuetest-gui-class py gui that displays data produced and queued by worker threads (class-basedimport threadingqueuetime from tkinter scrolledtext import scrolledtext or pp gui tour scrolledtext class threadgui(scrolledtext)threadsperclick def __init__(selfparent=none)scrolledtext __init__(selfparentself pack(self dataqueue queue queue(self bind(''self makethreadsself consumer( gui coding techniques infinite size on left mouse click queue loop in main thread