epaatampistle
This commit is contained in:
+7
-2
@@ -2,8 +2,13 @@ import os
|
||||
import sys
|
||||
import tkinter as tk
|
||||
|
||||
# Asegurar que el directorio raíz esté en el path para imports relativos
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
# Cuando se ejecuta como .exe (PyInstaller onefile), __file__ apunta a la
|
||||
# carpeta temporal de extracción. sys.executable apunta al .exe real.
|
||||
if getattr(sys, 'frozen', False):
|
||||
BASE_DIR = os.path.dirname(sys.executable)
|
||||
else:
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
if BASE_DIR not in sys.path:
|
||||
sys.path.insert(0, BASE_DIR)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user