def window_thread(): app = QApplication(sys.argv) w_command = CommandWindow() w_command.setRequester(requester) w_command.show() sys.exit(app.exec_())
event = threading.Event() while not w_command.is_closed: if w_command.requester_controller.can_ask: w_command.requester_controller.execute_command(0x0) event.wait(0.1) # Main 'function': instantiates a CommandWindow object and starts it. if __name__ == '__main__': reader = threading.Thread(target = reading_command_thread) app = QApplication(sys.argv) w_command = CommandWindow() w_command.show() # Starts reading thread reader.start() sys.exit(app.exec_())