epaatampistle

This commit is contained in:
2026-02-21 19:53:38 +01:00
parent a351036193
commit 859175f23a
9 changed files with 172 additions and 3 deletions
+7 -2
View File
@@ -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)