This commit is contained in:
@@ -5,9 +5,17 @@ import os
|
||||
import sys
|
||||
|
||||
|
||||
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
|
||||
def _project_root():
|
||||
if getattr(sys, "frozen", False):
|
||||
return os.path.dirname(os.path.abspath(sys.executable))
|
||||
return os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
PROJECT_ROOT = _project_root()
|
||||
if PROJECT_ROOT not in sys.path:
|
||||
sys.path.insert(0, PROJECT_ROOT)
|
||||
if getattr(sys, "frozen", False):
|
||||
os.chdir(PROJECT_ROOT)
|
||||
|
||||
from app.gui import main
|
||||
|
||||
|
||||
Reference in New Issue
Block a user