def run(self): while self.should_run(): win32gui.EnumWindows(self.foreach_window(), 0) self._stop.wait(0.5)