def main_loop(root):
        "Process all GUI events according to tkinter's settings."
        target = time.clock()
        while True:
            try:
                root.update()
            except tkinter.TclError:
                break
            target += tkinter._tkinter.getbusywaitinterval() / 1000
            time.sleep(max(target - time.clock(), 0))
Process all GUI events according to tkinter's settings.
recipes/Python/577633_Directory_Pruner_2/recipe-577633.py