-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_app.py
More file actions
51 lines (40 loc) · 1.5 KB
/
Copy pathrun_app.py
File metadata and controls
51 lines (40 loc) · 1.5 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
45
46
47
48
49
50
51
#!/usr/bin/env python3
"""
Launch script for MultiRegal - Automatic Multivariable Regression Analysis Calculator
This script launches the Streamlit web interface for the regression analyzer.
"""
import subprocess
import sys
import os
from pathlib import Path
def main():
"""Launch the Streamlit application."""
print("🔮 Starting MultiRegal - Automatic Regression Analysis Calculator")
print("=" * 60)
# Check if we're in the right directory
if not Path("app.py").exists():
print("❌ Error: app.py not found. Please run this script from the project root directory.")
return 1
# Set Streamlit configuration
os.environ.setdefault("STREAMLIT_SERVER_PORT", "8501")
os.environ.setdefault("STREAMLIT_SERVER_ADDRESS", "localhost")
try:
# Launch Streamlit
print("🚀 Launching web interface...")
print("📱 Open your browser and go to: http://localhost:8501")
print("⏹️ Press Ctrl+C to stop the server")
print("=" * 60)
subprocess.run([
sys.executable, "-m", "streamlit", "run", "app.py",
"--server.port", "8501",
"--server.address", "localhost",
"--browser.gatherUsageStats", "false"
])
except KeyboardInterrupt:
print("\n👋 Shutting down MultiRegal...")
return 0
except Exception as e:
print(f"❌ Error launching application: {e}")
return 1
if __name__ == "__main__":
sys.exit(main())