| #!/usr/bin/env python3 | |
| """ | |
| Simple runner script for the SD Roster Optimization Streamlit app. | |
| """ | |
| import subprocess | |
| import sys | |
| import os | |
| def main(): | |
| """Run the Streamlit app""" | |
| # Change to the project directory | |
| project_dir = os.path.dirname(os.path.abspath(__file__)) | |
| os.chdir(project_dir) | |
| # Run streamlit | |
| try: | |
| subprocess.run([ | |
| sys.executable, "-m", "streamlit", "run", "Home.py", | |
| "--server.port", "8501", | |
| "--server.address", "localhost" | |
| ], check=True) | |
| except subprocess.CalledProcessError as e: | |
| print(f"Error running Streamlit: {e}") | |
| return 1 | |
| except KeyboardInterrupt: | |
| print("\nStreamlit app stopped by user") | |
| return 0 | |
| return 0 | |
| if __name__ == "__main__": | |
| exit(main()) | |