From b8801ec0243693731c9839498d8c35a51b67e3e8 Mon Sep 17 00:00:00 2001 From: ila Date: Mon, 15 Jun 2026 16:44:33 +0800 Subject: [PATCH] fix: support isolated Python startup --- dev.bat | 3 +++ src/main.py | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 dev.bat diff --git a/dev.bat b/dev.bat new file mode 100644 index 0000000..86c35a3 --- /dev/null +++ b/dev.bat @@ -0,0 +1,3 @@ +title run +cd /d "%~dp0src" && python main.py +pause diff --git a/src/main.py b/src/main.py index ba6263c..2270ae2 100644 --- a/src/main.py +++ b/src/main.py @@ -1,5 +1,10 @@ import logging import sys +from pathlib import Path + +SRC_DIR = Path(__file__).resolve().parent +if str(SRC_DIR) not in sys.path: + sys.path.insert(0, str(SRC_DIR)) from PySide6.QtWidgets import QApplication