|
|
|
|
|
""" |
|
|
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) |
|
|
|
|
|
|
|
|
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) |
|
|
|
|
|
|
|
|
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: |
|
|
|
|
|
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() |
|
|
|