subhra subhra -3 years ago 162
Python Question

Getting error while doing subprocess call using Python and Django

I am getting some error while running the

script using Python and Django. The errors are given below.

Traceback (most recent call last):
File "", line 3, in <module>'./ param1 param2'))
File "/usr/lib/python2.7/", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/", line 1327, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied

I am explaining my code below.

import subprocess
import shlex

echo $1
echo $2
exit 0

While I was running the file I am getting the above error. Please help me to resolve this error.

Answer Source

Replace your'bash',param1,param2))

To'bash %s %s'%(param1,param2)))

or['bash', '', param1, param2])
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download