sys.exit(2) fullscreen = False for o, a in opts: if o == "-f": fullscreen = True else: assert False, "unhandled option" thermostat = None try: from thermostat import * thermoView = rootObject.findChild(QObject, 'thermostatView') thermostat = Thermostat(thermoView) thermostat.start() except: pass if (fullscreen): if thermostat is not None: view.installEventFilter(thermostat) view.showFullScreen() app.setOverrideCursor(Qt.BlankCursor) else: view.show() app.exec_() weather.stop() if thermostat is not None: thermostat.stop()