Typically when running apps locally, the app may leverage the multi-thread presented on a local computer. However, when hosted on a cloud server running on a single CPU core, it may consume all the available resource.
It seems that you want to run a command line cmd via subprocess.run(). I’ve performed something similar in a Streamlit app that runs an R script in the command line but instead of run, I’ve used Popen. Check out the following video and code repo: