def run(): global appMainForm, appImagesForm app = QtGui.QApplication(sys.argv) appMainForm = MainWindow() appImagesForm = ImagesSelectionForm() appMainForm.show() sys.exit(app.exec_())
def main(): try: qApp = QtWidgets.QApplication(sys.argv) aw = MainWindow() sys.exit(qApp.exec_()) except Exception as err: Error_handel().write(err, region='gui') sys.exit()
""" Entry point for application. You may run this without a GUI by passing in the absolute path to the Template document and the Variables workbook as command line arguments. """ import sys from PyQt5.QtWidgets import QApplication from gui.gui import MainWindow from automation.automate import Automate if __name__ == '__main__': if sys.argv[1:]: if len(sys.argv[1:]) != 2: print('To run this without a GUI, please supply the absolute paths to the Template and Variables files ' 'enclosed in quotes. For example: ') print(r'python main.py "C:\path\to\template.docx" "C:\path\to\variables.xls"') else: template_file, vars_file = sys.argv[1], sys.argv[2] automation = Automate(in_gui=False) automation.run(template_file, vars_file) else: app = QApplication(sys.argv) main = MainWindow() main.show() sys.exit(app.exec_())
''' Created on Jan 13, 2014 @author: Eugene Syriani @version: 0.2.5 This is the main BiBler module. Execute this module from the command line to start the application. @note: It assumes that the L{app} package has a L{statechart.BiBler_Statechart} class and a L{UserInterface.UserInterface} class that implements L{gui.app_interface.IApplication}. G{packagetree app, gui, utils} ''' import wx from gui.gui import MainWindow from gui.controller import Controller from app.statechart import BiBler_Statechart from app.UserInterface import UserInterface if __name__ == '__main__': app = wx.App(False) controller = Controller() controller.bindGUI(MainWindow(controller)) controller.bindSC(BiBler_Statechart()) controller.bindApp(UserInterface()) controller.start() app.MainLoop()
nn = NeuralNetwork() nn.train_model() elif start_argument == 'test': nn = NeuralNetwork(load_existing_data=True) # nn.test_accuracy() nn.test_accuracy_custom() elif start_argument == 'predict': nn = NeuralNetwork(load_existing_data=True) print('Ввод текстов активен (CTRL + C для выхода)') try: while True: text = input('> ') prediction = nn.predict(text) print(f'{prediction[0]} [{prediction[1]}]') except (KeyboardInterrupt, SystemExit): print('До свидания!') else: raise InvalidStartParameter exit(0) app = QtWidgets.QApplication(argv) main_window = MainWindow() main_window.show() exit(app.exec_())
from PyQt5 import QtGui import qdarkstyle import signal signal.signal(signal.SIGINT, signal.SIG_DFL) if __name__ == '__main__': cfg = config.load(sys.argv[1]) try: img_path=sys.argv[2] except IndexError: img_path=None jdrc= comm.init(cfg, 'ColorTuner') cameraCli = jdrc.getCameraClient("ColorTuner.Camera") camera = CameraFilter(cameraCli) app = QApplication(sys.argv) frame = MainWindow(img_path) frame.setCamera(camera) frame.show() app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5()) t2 = ThreadGUI(frame) t2.daemon=True t2.start() sys.exit(app.exec_())
import sys from gui.gui import MainWindow, Run if __name__ == "__main__": mainWindow = MainWindow() sys.exit(Run(sys.argv, mainWindow))
from sensors.cameraFilter import CameraFilter from gui.gui import MainWindow from PyQt5.QtWidgets import QApplication from PyQt5 import QtGui import qdarkstyle import signal signal.signal(signal.SIGINT, signal.SIG_DFL) if __name__ == '__main__': cfg = config.load(sys.argv[1]) #starting comm jdrc = comm.init(cfg, 'ColorTuner') cameraCli = jdrc.getCameraClient("ColorTuner.Camera") camera = CameraFilter(cameraCli) app = QApplication(sys.argv) frame = MainWindow() frame.setCamera(camera) frame.show() app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5()) t2 = ThreadGUI(frame) t2.daemon = True t2.start() sys.exit(app.exec_())
def main(): import sys app = QApplication(sys.argv) w = MainWindow() sys.exit(app.exec_())