This repository was archived by the owner on Apr 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
44 lines (37 loc) · 1.68 KB
/
run.py
File metadata and controls
44 lines (37 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
"""
Скрипт для запуска Backtest Dashboard.
"""
import subprocess
import sys
import os
def main():
"""Запускает Streamlit-приложение."""
# Проверяем наличие файла app.py
if not os.path.exists('app.py'):
print("❌ Ошибка: Файл app.py не найден!")
print("Убедитесь, что вы находитесь в правильной директории.")
sys.exit(1)
# Проверяем наличие папки с данными
if not os.path.exists('input/batch-backtest-09-2025'):
print("⚠️ Предупреждение: Папка input/batch-backtest-09-2025 не найдена!")
print("Создайте папку и поместите туда JSON-файлы с результатами бэктестов.")
print("🚀 Запуск Backtest Dashboard...")
print("📊 Приложение будет доступно по адресу: http://0.0.0.0:8501")
print("🌐 Доступ извне: http://[YOUR_IP]:8501")
print("⏹️ Для остановки нажмите Ctrl+C")
print("-" * 50)
try:
# Запускаем Streamlit
subprocess.run([
sys.executable, '-m', 'streamlit', 'run', 'app.py',
'--server.port', '8501',
'--server.address', '0.0.0.0'
])
except KeyboardInterrupt:
print("\n👋 Приложение остановлено пользователем.")
except Exception as e:
print(f"❌ Ошибка при запуске: {e}")
sys.exit(1)
if __name__ == "__main__":
main()