dash and training wip

This commit is contained in:
Dobromir Popov
2025-09-02 15:30:05 +03:00
parent 443e8e746f
commit 1b54438082
14 changed files with 270 additions and 197 deletions

View File

@@ -3,6 +3,34 @@
Clean Trading Dashboard Runner with Enhanced Stability and Error Handling
"""
# Ensure we run with the project's virtual environment Python
try:
import os
import sys
from pathlib import Path
import platform
def _ensure_project_venv():
try:
project_root = Path(__file__).resolve().parent
if platform.system().lower().startswith('win'):
venv_python = project_root / 'venv' / 'Scripts' / 'python.exe'
else:
venv_python = project_root / 'venv' / 'bin' / 'python'
if venv_python.exists():
current = Path(sys.executable).resolve()
target = venv_python.resolve()
if current != target:
os.execv(str(target), [str(target), *sys.argv])
except Exception:
# If anything goes wrong, continue with current interpreter
pass
_ensure_project_venv()
except Exception:
pass
import sys
import logging
import traceback