How to run a subprocess programs using thread inside streamlit?

You probably want to use thread.join() in your main thread, after creating the job thread. Something like:

job_thread = PopenCall(onExit, PopenArgs)
job_thread.join()  # this will block until the thread exits
1 Like