def display_page(pathname): if pathname == '/': return Homepage() elif pathname == '/UpLoad': File_details.clear() PharmacoInformation[0] = '' PharmacoInformation[1] = '' PharmacoInformation[2] = '' return Upload() elif pathname == '/MainWindow': if PharmacoInformation[0] == '' or PharmacoInformation[ 1] == '' or PharmacoInformation[2] == '': return MainWindow() else: file_UploadedInfo = [] storeList = [] start = 0 while start < len(PharmacoInformation): storeList.append(PharmacoInformation[start]) start = start + 1 file_UploadedInfo.append(storeList[2]) file_UploadedInfo.append(storeList[0]) file_UploadedInfo.append(Coordinates[storeList[1]]) variant_Info = Pharmaco_VariantParse( get_EnzymeVariants(Database, storeList[0]), File_details[0]) file_UploadedInfo.append(variant_Info[1]) file_UploadedInfo.append(variant_Info[2]) file_UploadedInfo.append(variant_Info[0]) file_UploadedInfo.append(variant_Info[3]) upLoaded_Details.append(file_UploadedInfo) return MainWindow()
def main(): #setup the container app = QApplication(sys.argv) window = MainWindow() window.window_quit_signal.connect(app.quit) window.show() sys.exit(app.exec_())
def main(): global app global mainWindow app = QApplication(sys.argv) mainWindow = MainWindow() mainWindow.show() sys.exit(app.exec_())
def main (): #make sure to shown tacskIcon right when use pyinstaller to make exe file you can commont it ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("BatterayDetection") me = singleton.SingleInstance() app = QtGui.QApplication(sys.argv) splash = QSplashScreen(QPixmap(":/Start/Resource/start.png"), Qt.WindowStaysOnTopHint) splash.setDisabled(True) # Disables widget input events, or when mouse click splash will be hide splash.show() splash.showMessage("Start Application ......", Qt.AlignBottom, Qt.black) app.processEvents() start = time() while time() - start < 1: sleep(0.1) app.processEvents() login = Login() #login.show() splash.finish(login) if (login.exec_() == QtGui.QDialog.Accepted) : main = MainWindow() main.show() sys.exit(app.exec_())
def __init__(self): super().__init__() self.setWindowIcon(QtGui.QIcon(r'####')) self.setWindowTitle('MGN - Login') self.resize(250, 100) self.MainWindow = MainWindow() layout = QGridLayout() usuario = QLabel('Usuário:') senha = QLabel('Senha:') layout.addWidget(usuario, 0, 0) layout.addWidget(senha, 1, 0) self.lineusuario = QLineEdit() self.lineusuario.setPlaceholderText('Informe seu nome de usuário') layout.addWidget(self.lineusuario, 0, 1) self.linesenha = QLineEdit() self.linesenha.setPlaceholderText('Informe sua senha') self.linesenha.setEchoMode(QLineEdit.Password) layout.addWidget(self.linesenha, 1, 1) botaologin = QPushButton('Login') botaologin.clicked.connect(self.press_login) layout.addWidget(botaologin, 2, 0, 2, 2) self.setLayout(layout)
def __init__(self, file_paths, platform): """ ActionHandler constructor. Create the main window, setup the message handler, import the preferences, and connect all of the action handlers. Finally, enter the gtk main loop and block. @param file_paths a list of flow graph file passed from command line @param platform platform module """ self.clipboard = None for action in Actions.get_all_actions(): action.connect('activate', self._handle_action) #setup the main window self.main_window = MainWindow(platform) self.main_window.connect('delete-event', self._quit) self.main_window.connect('key-press-event', self._handle_key_press) self.get_page = self.main_window.get_page self.get_flow_graph = self.main_window.get_flow_graph self.get_focus_flag = self.main_window.get_focus_flag #setup the messages Messages.register_messenger(self.main_window.add_report_line) Messages.send_init(platform) #initialize self.init_file_paths = file_paths Actions.APPLICATION_INITIALIZE() #enter the mainloop gtk.main()
def createProject(self, window_ref, project_name, ref): ''' window_ref: (QDialog) reference to the window that function is called from project_name: (str) name of new project ref: (tuple) reference point ''' project_file = os.path.join(PROJECTS_DIR, project_name, 'project_data.json') created_date = QDateTime().currentDateTime().toString( 'MM-dd-yyyy hh:mm:ss ap') default_data = { 'ProjectName': project_name, 'Created': created_date, 'LastAccessed': created_date, 'Reference': ref, 'Scale': 0, 'Units': '', 'Points': [] } try: os.makedirs(os.path.join(PROJECTS_DIR, project_name, 'Reports')) with open(project_file, 'w+') as f: f.write(json.dumps(default_data)) except FileExistsError: QMessageBox.critical(window_ref, 'Project Creation Error', f'Invalid project name: {project_name}') else: window_ref.close() self.mw = MainWindow(project_name, self, openExisting=True, api=self.settings.get('API'))
def open_mainwindow(user): global main_window main_window = MainWindow(user, send_message, refresh, close_main_window, send_pic_func, send_icon_func, ask_inform, get_inform, send_inform) #创建一个主界面的实例 Thread(target=recv_data).start() #新开一个线程接收数据 main_window.show() #显示主界面
def main(): """m_excel = ExcelObject() m_excel.Open("") cell,sheet,m_len = m_excel.getCell(1, "A", "Sheet1", "C", False) print(type(cell.Value2)) cell.Interior.ColorIndex = 6 #m_excel.setCellValue(1, "A", "Sheet1", True, [[0,1,2],[0,1,2]]) #print(m_excel.getCellValue(1,"A","Sheet1","B")) cell,sheet,m_len = m_excel.getCell(1, "A", "Sheet1", "C") v = [] for i in range(0,len(cell.Value2[0])): if i == 1: v.append(10) else: v.append(cell.Value2[0][i]) cell.Value2 = v#""" #print(thread.get_ident()) mgr = OpenRTM_aist.Manager.init(sys.argv) mgr.setModuleInitProc(MyModuleInit) mgr.activateManager() mgr.runManager(True) global excel_comp app = QtGui.QApplication([""]) mainWin = MainWindow(excel_comp, mgr) #mainWin = MainWindow(None, None) mainWin.show() app.exec_() mgr.shutdown()
def main(): app = QApplication(sys.argv) main_window = MainWindow() main_window.show() r = app.exec_() main_window.cleanup() sys.exit(r)
def __init__(self): my_logger = getLogger('py4j') handler = StreamHandler() handler.setLevel(DEBUG) my_logger.setLevel(DEBUG) my_logger.addHandler(handler) if glob.glob("./lib/py4j-0.8.1.jar"): jarpath = glob.glob("./lib/py4j-0.8.1.jar")[0] elif glob.glob("./py4j-0.8.1.jar"): jarpath = glob.glob("./py4j-0.8.1") else: jarpath = None if glob.glob("./lib/droidnavi-gateway-server*"): classpath = glob.glob("./lib/droidnavi-gateway-server*") elif glob.glob("./droidnavi-gateway-server*"): classpath = glob.glob("./droidnavi-gateway-server*")[0] else: classpath = None self.__gateway = JavaGateway.launch_gateway(jarpath=jarpath, classpath=classpath, die_on_exit=True) print self.__gateway app = QtGui.QApplication(sys.argv) mainWindow = MainWindow(self.__gateway) sys.exit(app.exec_())
def open_main_window(): global main_window main_window = MainWindow(send_message, close_main_window) t = Thread(target=recv_data) t.setDaemon(True) t.start() main_window.show()
def main(): app = QApplication(sys.argv) window = MainWindow() window.show() sys.exit(app.exec_())
def openmain(self): while not IsSuccess: #성공하면 끝나는 무한루프 continue self.loginwindow.hide() self.newWindow = MainWindow(USERID) self.newWindow.show() self.hide()
def test_recording_tab_file_finder(self): # create the app # main window init inference_interface = InferenceInterface() window = MainWindow(inference_interface=inference_interface) window.hide() # no need to display the window when unit testing window.recordingTab.SelectDataDirBtn.click()
def __init__(self): self.mb = None self.window = MainWindow() height, width = self.window._screen.getmaxyx() registers_width = 9 console_height = 20 console_width = min(80, width - registers_width) - 1 self.program = ProgramPad( (2, 1), (height - console_height - 2 - 1, width - 30)) self.registers = RegistersPad( (height - console_height, console_width + 2), (7, registers_width)) self.flags = FlagPad( (height - console_height, console_width + registers_width + 3), (7, 7)) self.console = ConsolePad((height - console_height, 1), (console_height, console_width)) logger.setLevel(logging.DEBUG) ch = CursesHandler(self.console) ch.setLevel(logging.DEBUG) ch.setFormatter( logging.Formatter( '%(relativeCreated)-8d %(levelname)-8s %(message)s')) logger.addHandler(ch) self.pads = [self.program, self.console, self.registers, self.flags] self.running = False self.console.switch() self.commandBuffer = []
def main(argv): # Create logger directory logDir = os.path.abspath('../temp') if not os.path.exists(logDir): os.mkdir(logDir) # Setup logger, configure verbosity. # Possible values are: # INFO, DEBUG, WARN, WARNING, # CRITICAL, FATAL, ERROR logger.basicConfig( level=logger.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt='%m-%d %H:%M', filename='../temp/' + datetime.datetime.now().strftime("%m%d%Y-%H%M%S") + '.log', filemode='w') # define a Handler which writes INFO messages or higher to the sys.stderr console = logger.StreamHandler() console.setLevel(logger.INFO) # set a format which is simpler for console use formatter = logger.Formatter('%(name)-12s: %(levelname)-8s %(message)s') # tell the handler to use this format console.setFormatter(formatter) # add the handler to the root logger logger.getLogger('').addHandler(console) # Setup and run application app = QApplication(argv) w = MainWindow() w.show() sys.exit(app.exec_())
def __init__(self): config.init('./config.cfg') logfile = config.get('logfile', None) loglevel = config.get('loglevel', None) if loglevel == 'crit': loglevel = logging.CRITICAL pass elif loglevel == 'error': loglevel = logging.ERROR pass elif loglevel == 'warn': loglevel = logging.WARNING pass elif loglevel == 'info': loglevel = logging.INFO pass elif loglevel == 'debug': loglevel = logging.DEBUG pass else: loglevel = None logging.basicConfig(filename=logfile, level=loglevel, format='%(asctime)-15s %(message)s') logging.debug('main thread id: %s', threading.get_ident()) self.wMain = MainWindow() self.wMain.onOk = self.onWndOk self.wMain.onCancel = self.onWndCancel self.wMain.start() pass
def __init__(self, *args): QApplication.__init__(self, *args) self.firstOpen = True # main objects in window self.serialSelector = None self.serialHandler = None self.main = None # configure general pyqtgraph options self.configurePyQtGraph() # Serial configurator self.device = 'COM4' self.baudrate = 115200 # Prepare Serial handler self.serialHandler = SerialHandler(self) self.serialHandler.bufferUpdated.connect(self.updateData) # main window self.main = MainWindow(self) self.lastWindowClosed.connect(self.closeWindow) self.configureSlots() self.main.setWindowTitle('Motor GUI') self.main.show() # prepare variables self.isDeviceInit = False self.isFirstMessage = True self.showData = False self.isMoving = False self.controllers = ['Position','Speed','Tension'] self.selectedController = 'Position' self.motors = ['M1','M2','M3','M4','M5','M6'] self.motors_idx = [F1_MF_IDX,F1_ME_IDX,F2_MF_IDX,F2_ME_IDX,F3_MF_IDX,F3_ME_IDX] self.selectedMotor = F1_ME_IDX #'M1' # data logging self.isLogging = False self.wasDataSaved = False self.logFile = None self.logHandler = None self.logFilename = None # set initial buttons states self.main.buttonStart.setEnabled(False) self.main.buttonStop.setEnabled(False) self.main.buttonReset.setEnabled(False) self.main.buttonSend.setEnabled(False) self.main.buttonSelectController.setEnabled(False) self.cmd = MotorCommand() self.CMD = namedtuple('CMD', 'id cmd pref P I D')
def __init__(self, args): super(App, self).__init__() QCoreApplication.setOrganizationName('Dynart') QCoreApplication.setApplicationName('NodeEditor') self._qApp = QApplication(args) self._qApp.setStyle(Style()) self._mainWindow = MainWindow(self) self._mainWindow.show()
def main(args): """ Main générale du TP """ app = QApplication(args) win = MainWindow(1024,800) win.show() app.exec_()
def main(): app = QApplication(sys.argv) window = MainWindow() window.show() # exit code == PySide returned val sys.exit(app.exec_())
def closeEvent(self, event): if self.MassageBox: self.MassageBox.destroy() if self.recordWindow: self.recordWindow.destroy() self.mainWindow2 = MainWindow() self.mainWindow2.show() self.destroy()
def on_LoginOKButton_clicked(self): name = self.userNameLogin.text() passwd = self.userPasswordLogin.text() self.sql_handle = sql_handle.SqlHandle(name, key = passwd) self.mainWindow = MainWindow(table_name = name, password = passwd, sql = self.sql_handle) self.mainWindow.show() # self.accept() self.close()
def main(): app = QApplication(sys.argv) mainWindow = MainWindow() mainWindow.move(app.screens()[0].geometry().topLeft()) mainWindow.showMaximized() mainWindow.dataWindow.move(app.screens()[-1].geometry().topLeft()) mainWindow.dataWindow.showMaximized() sys.exit(app.exec())
def main(): app = QApplication(sys.argv) app.setApplicationName("Icons") app.setApplicationVersion("1.0") mainWin = MainWindow() mainWin.show() return app.exec_()
def main(): app = QApplication(sys.argv) app.setStyle('Fusion') app.setPalette(setPalette()) ui = MainWindow() ui.show() sys.exit(app.exec_())
def main(): root = Tk() app = MainWindow(root) app.pack() root.title("Курсовой проект / Методы обработки эксперементальных данных") root.geometry('1400x820') root.resizable(False, False) root.mainloop()
def main(): app = QApplication([]) LitLimeWindow = MainWindow() LitLimeWindow.show() app.exec_() LitLimeWindow.stop_all_threads()
def main(): app = QApplication(sys.argv) app.setStyle('Fusion') ex = MainWindow() ex.show() print("here goes") sys.exit(app.exec_())