示例#1
0
def main():
    import logging
    import sys
    from pyqode.qt.QtWidgets import QApplication
    from UI import MainWindow

    # Logging
    filename = None
    if sys.platform == 'win32':
        filename = 'PyCreator.log'
        logging.basicConfig(level=logging.INFO,
                            filename=filename)  # save log to file

    app = QApplication(sys.argv)

    # ~To Do~
    # create a function to set the style by passing in the app object
    # or load style sheet from file?
    app.setStyle('Fusion')  # Needed to make dark theme look right

    win = MainWindow()
    win.show()

    sys.exit(app.exec_())
示例#2
0
def main(args = None):
	if args is None:
		args = sys.argv

	app = QtWidgets.QApplication(args)

	mainWindow = MainWindow(None)
	serialReader = SerialReader(None, exchangeRowsColumns = False)

	serialReader.statusString.connect(mainWindow.updateStatus)
	serialReader.serialPortsUpdated.connect(mainWindow.updateSerialPorts)
	serialReader.pressureMapUpdated.connect(mainWindow.updateMap)
	mainWindow.serialPortSelected.connect(serialReader.setSerialName)
	mainWindow.serialConnectReq.connect(serialReader.connectSerial)
	mainWindow.serialDisconnectReq.connect(serialReader.disconnectSerial)

	ports = serialReader.listSerialPorts()
	mainWindow.updateSerialPorts(ports)

	app.aboutToQuit.connect(quitEventHandler)

	serialReader.start()
	mainWindow.show()
	sys.exit(app.exec_())
示例#3
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 21 03:05:49 2018

@author: unixuser
"""
from PyQt5 import QtWidgets

import sys
sys.path.insert(0, r'.\UI')

from UI import MainWindow

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    mainwindow = MainWindow()
    mainwindow.show()
    sys.exit(app.exec_())
示例#4
0
import sys
from UI import MainWindow
from PyQt5 import QtWidgets

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec_())
示例#5
0
def main():
    app = QtGui.QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec_())