I am developing a web app using django. I've a script shell that runs python codes for image processing. I want to execute this script shell using my web app so that users can apply image processing just by using a button in the web interface. (for the moment i'm working localy , the django web app and the script shell are in the same folder). I don't know how to do it. can you help me ? thank you in advance.
1 Answer
Python standard library has the subprocess module which can be used just for that. For instance, given ./script.sh is your shell script a call to subprocess.call will do the work:
>>> import subprocess
>>> # From your working directory:
>>> subprocess.call(["./script.sh"])