-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
34 lines (25 loc) · 1.1 KB
/
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
import traceback
from irspy.qt import ui_to_py
ui_to_py.convert_ui("./ui", "./ui/py", resources_path="irspy.qt.resources")
ui_to_py.convert_resources("./irspy/qt/resources", "./irspy/qt/resources")
def main():
# Импорты здесь, чтобы ловить их исключения в скомпиленной версии программы, если они возникнут при импорте
import sys
from PyQt5.QtWidgets import QApplication
from PyQt5 import QtCore, QtGui
from mainwindow import MainWindow
app = QApplication(sys.argv)
app.setStyle("Fusion")
app.setFont(QtGui.QFont("MS Shell Dlg 2", 10))
translator = QtCore.QTranslator(app)
path = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)
translator.load("/".join([path, "qtbase_ru.qm"]))
app.installTranslator(translator)
w = MainWindow()
sys.exit(app.exec())
if __name__ == "__main__":
try:
main()
except Exception as err:
print(traceback.format_exc())
# input("Error. Press enter to continue...")