I am trying to execute a python script from a webpage through a Django view. Other questions related to a known script from within the Django project directory. I need to be able to execute a script anywhere on the system given the file path. Eventually, multiple scripts will be run in parallel using Celery or a similar method. Should I be using some permutation of popen or sub-processing?
I suggest using Celery.
subprocess
, multiprocessing
, and threading
all are powerful tools, but are in general hard to get working. They're more useful if you already have a working system, are running at the limit of the hardware, and don't mind spending a good deal of effort to get lower latency or parallel processing or higher throughput.