Grovey

@echo off

@echo off

REM Set environment variable to suppress the welcome screen

set STREAMLIT_SERVER_HEADLESS=true 

set STREAMLIT_BROWSER_GATHERUSAGESTATS=false


REM Change to the directory containing your Streamlit app

cd /d "C:\path\to\your\streamlit\app"


REM Run the Streamlit app using the specified Python executable

"C:\Python39\python.exe" -m streamlit run app.py


REM Close the command prompt window after execution

exit


REM Change to the directory containing your Streamlit app

cd /d "C:\path\to\your\streamlit\app"


REM Run the Streamlit app using the specified Python executable

"C:\Python39\python.exe" -m streamlit run app.py


REM Keep the command prompt open after execution

pause



path - C:\Windows\System32\cmd.exe

C:\path\to\your\batchfile

Step 4: Configure the Service Using NSSM GUI

  1. Path:

    • In the Application tab, for the Path field, browse to your cmd.exe executable, typically located at C:\Windows\System32\cmd.exe.
  2. Startup Directory:

    • Set the Startup directory to the directory where your batch file is located, for example, C:\path\to\your\batchfile.
  3. Arguments:

    • In the Arguments field, enter:
      shell
      /c "C:\path\to\your\batchfile\run_streamlit.bat"
  4. I/O Redirection (Optional):

    • If you want to capture the output of the batch file, go to the I/O tab and specify files for Output (stdout) and Error (stderr).
  5. Click Install Service:

    • Click the Install service button.
#,##0.00;(-#,##0.00)

Comments

Popular posts from this blog

host

Steps to create SSH key from git bash

test