

# Name of your Streamlit app
app_file = "hlst.py"
batch_file = "run_hlst.bat"

import sys,os

# Get full Python executable path
python_exe = sys.executable

# Streamlit command using Python path
command = f'"{python_exe}" -m streamlit run "{app_file}"\n'

# Check if batch file already exists
if os.path.exists(batch_file):
    print(f"❌ Error: {batch_file} already exists. Aborting.")
else:
    with open(batch_file, "w", encoding="utf-8") as f:
        f.write("@echo off\n")
        f.write("REM Auto-generated batch file to run Streamlit app\n")
        f.write("cd /d %~dp0\n")  # ensure we run from script directory
        f.write(command)
        f.write("pause\n")
    print(f"✅ Created {batch_file}")

