def run_testlauncher(package): """Run test launcher""" from guidata.qt.QtGui import QApplication app = QApplication([]) win = TestLauncherWindow(package) win.show() app.exec_()
def show_std_icons(): """ Show all standard Icons """ app = QApplication(sys.argv) dialog = ShowStdIcons(None) dialog.show() sys.exit(app.exec_())
def test(): from guidata.qt.QtGui import QApplication app = QApplication([]) win = TestWindow() win.setup_window() win.show() app.exec_()
def qapplication(): """ Return QApplication instance Creates it if it doesn't already exist """ from guidata.qt.QtGui import QApplication app = QApplication.instance() if not app: app = QApplication([]) install_translator(app) return app
def main(): # Init the Qt basics from guidata.qt.QtGui import QApplication app = QApplication(sys.argv) app.setApplicationName("Zupport") app.setApplicationVersion(__version__) app.setOrganizationName("HU") app.setOrganizationDomain("MRG") window = MainWindow() window.show() sys.exit(app.exec_())
def test(): """Testing this simple Qt/guiqwt example""" from guidata.qt.QtGui import QApplication import numpy as np import scipy.signal as sps, scipy.ndimage as spi app = QApplication([]) win = TestWindow() x = np.linspace(-10, 10, 500) y = np.random.rand(len(x)) + 5 * np.sin(2 * x**2) / x win.add_plot(x, y, lambda x: spi.gaussian_filter1d(x, 1.), "Gaussian") win.add_plot(x, y, sps.wiener, "Wiener") win.show() app.exec_()
except Exception as e: msg = "Unable to write pidfile: %s %s" % (pidfile, str(e)) log.exception(msg) sys.stderr.write(msg + "\n") sys.exit(1) if __name__ == '__main__': if Platform.is_windows(): # Let's kill any other running instance of our GUI/SystemTray before starting a new one. kill_old_process() if len(sys.argv) > 1 and "-stop" in sys.argv: # just return. The kill_old_process() should have terminated the process, # and now we're done. sys.exit(0) app = QApplication([]) if Platform.is_mac(): add_image_path(osp.join(os.getcwd(), 'images')) # add datadog-agent in PATH os.environ['PATH'] = "{0}:{1}".format('/opt/datadog-agent/bin/', os.environ['PATH']) win = SystemTray() if len(sys.argv) < 2 else MainWindow() else: win = MainWindow() # Let's start the agent if he's not already started if agent_status() not in [AGENT_RUNNING, AGENT_START_PENDING]: agent_manager('start') win.show() app.exec_()
glob_para = ode_solver.init_glob_para(HC) pv_model = ode_solver.compute_ode(Rp, Ra, Rin, Ca, Cv, Vd, Emax, Emin, t, start_v, start_pa, start_pv) Plv_vector = [ ode_solver.Plv(v, Vd, Emax, Emin, x) for x, v in zip(t, pv_model[0]) ] #print(pv_model[0]) col = ["b", "r", "k", "c", "m"] mypen = PG.mkPen(col[self.number_plots], width=3) self.pw1.plot(t, np.array(pv_model[0]), pen=mypen) self.pw2.plot(t, np.array(Plv_vector), pen=mypen) self.pw3.plot(np.array(pv_model[0]), np.array(Plv_vector), pen=mypen) if self.number_plots < 4: self.number_plots += 1 else: self.number_plots = 0 print('PV loop computed') if __name__ == '__main__': from guidata.qt.QtGui import QApplication app = QApplication(sys.argv) window = MainWindow() window.show() sys.exit(app.exec_())