-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
37 lines (29 loc) · 1.02 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
35
36
37
import asyncio
import os
from asyncio.subprocess import Process
from pathlib import Path
from PySide6.QtWidgets import QApplication
import sys
from widgets.app_main_window import MainWindow
from widgets.app_tray_icon import run
if getattr(sys, "frozen", False):
bundle_dir = Path(getattr(sys, "_MEIPASS", os.path.abspath(os.path.dirname(__file__))))
else:
bundle_dir = Path().parent
if __name__ == "__main__":
if not QApplication.instance():
app = QApplication(sys.argv)
else:
app = QApplication.instance()
app.setStyle("Fusion")
app.setStyleSheet((bundle_dir / "stylesheet.qss").read_text())
window = MainWindow()
window.show()
window.resize(800, 600)
app.run = run(window)
# async def apistart():
# # process: Process = await asyncio.create_subprocess_exec('python','api/main.py')
# process: Process = await asyncio.create_subprocess_exec('.\dist\\api\\api.exe')
# print(f'Process pid is: {process.pid}')
# asyncio.run(apistart())
sys.exit(app.exec())