I try to do this by using subprocess in a views.py
returnCode = subprocess.call('/Users/ivanlw/Projects/C/app') #use the absolute path
print 'returnCode', returnCode
the app file just prints a sentence, it’s normal when I execute it in the terminal
but finally the debug page of django tells me OSError, the Exception Value shows: [Errno 2] No such file or directory
How to solve it?
You could try this:
a) check the answer to this question. It shows how to start a subprocess which runs in the background.
b) As the error code states the process does not find the file you want to call. If the path is correct maybe change the permissions on the app file.
c) Try to start the subprocess via the shell to see whether it also fails from there: