-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
34 lines (31 loc) · 915 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python3
'''PyNMR, J.Maxwell 2020
'''
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from app.gui import MainWindow
import sys
import getopt
def main():
'''Main executable calls main gui
'''
config_file = 'pynmr_config.yaml'
try:
opts, args = getopt.getopt(sys.argv[1:],"hc:")
except getopt.GetoptError:
print('Error: main.py [-c <config_file>]')
sys.exit(2)
for opt, arg in opts:
if opt in ['-h',]:
print('Usage: main.py [-c <config_file>]')
sys.exit()
elif opt in ['-c',]:
config_file = arg
app = QtWidgets.QApplication([])
#app.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) #enable highdpi scaling
app.setApplicationName("JLab Polarization Display")
gui = MainWindow(config_file)
gui.show()
app.exec_()
if __name__ == '__main__':
main()