Errno 13: Passing Python variables to bash script -


this question has answer here:

currently testing simple piece of code. want write python script sets variable , pass variable bash script use.

python script:

from subprocess import check_call = str(3) check_call(["/home/desktop/bash2pytest/test.sh", a], shell=false) 

bash script:

#!/bin/bash echo "this number sent py script: " $1 

i have read other q&as related topic; however, not finding solution conceptually understand; thus, syntax above might incorrect. have tried few other methods well; however, keep receiving following error:

traceback (most recent call last):   file "/home/cassandra/desktop/bash2pytest/callvar.py", line 3, in <module>     check_call(["/home/cassandra/desktop/bash2pytest/test.sh", a],    shell=false)   file "/usr/lib64/python2.7/subprocess.py", line 537, in check_call     retcode = call(*popenargs, **kwargs)   file "/usr/lib64/python2.7/subprocess.py", line 524, in call     return popen(*popenargs, **kwargs).wait()   file "/usr/lib64/python2.7/subprocess.py", line 711, in __init__ errread, errwrite)   file "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child     raise child_exception oserror: [errno 13] permission denied  process finished exit code 1 

any appreciated. i'm stumped.

try

chmod +x /home/desktop/bash2pytest/test.sh 

in shell. file trying execute not executable.

or option in python script:

check_call(["sh","/home/desktop/bash2pytest/test.sh", a], shell=false) 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -