File size: 1,814 Bytes
4b35e49 |
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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
#!/usr/bin/env python3
"""
Startup script for the Sentiment Analysis Testing Ground Streamlit application.
This script provides an easy way to launch the application with proper configuration.
"""
import subprocess
import sys
import os
def main():
"""Main function to start the Streamlit application."""
print("π§ Starting Sentiment Analysis Testing Ground...")
print("=" * 50)
# Check if app.py exists
if not os.path.exists("app.py"):
print("β Error: app.py not found in current directory!")
print("Please make sure you're in the correct directory.")
sys.exit(1)
# Check if requirements are installed
try:
import streamlit
import pandas
import PIL
print("β
Dependencies check passed")
except ImportError as e:
print(f"β Missing dependency: {e}")
print("Please install requirements: pip install -r requirements.txt")
sys.exit(1)
print("π Launching Streamlit application...")
print("π± The app will open in your default browser")
print("π If it doesn't open automatically, go to: http://localhost:8501")
print("βΉοΈ Press Ctrl+C to stop the application")
print("=" * 50)
try:
# Start Streamlit with the app
subprocess.run(
[
sys.executable,
"-m",
"streamlit",
"run",
"app.py",
"--server.headless",
"false",
"--server.port",
"8501",
]
)
except KeyboardInterrupt:
print("\nπ Application stopped by user")
except Exception as e:
print(f"β Error starting application: {e}")
sys.exit(1)
if __name__ == "__main__":
main()
|