-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (27 loc) · 984 Bytes
/
Copy pathmain.py
File metadata and controls
35 lines (27 loc) · 984 Bytes
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
import sys
from pathlib import Path
APP_DIR = Path(__file__).resolve().parent
PROJECT_ROOT = APP_DIR.parent
LOCAL_MODAL_PACKAGE_ROOT = PROJECT_ROOT / "WaveguideModalBPM1D"
# Evita que a pasta local "PySide6/" do workspace sombreie o pacote PySide6 instalado.
cleaned_sys_path = []
for entry in sys.path:
resolved = Path(entry or ".").resolve()
if resolved == PROJECT_ROOT:
continue
cleaned_sys_path.append(entry)
sys.path[:] = cleaned_sys_path
if str(APP_DIR) not in sys.path:
sys.path.insert(0, str(APP_DIR))
if LOCAL_MODAL_PACKAGE_ROOT.exists() and str(LOCAL_MODAL_PACKAGE_ROOT) not in sys.path:
# Prefer local workspace package implementation.
sys.path.insert(0, str(LOCAL_MODAL_PACKAGE_ROOT))
from PySide6.QtWidgets import QApplication
from ui.main_window import MainWindow
def main() -> int:
app = QApplication(sys.argv)
window = MainWindow()
window.show()
return app.exec()
if __name__ == "__main__":
sys.exit(main())