現在、非常に単純なコードをテストしています。変数を設定し、その変数をbashスクリプトに渡して使用するPythonスクリプトを作成するだけです。Errno 13:bashスクリプトにPython変数を渡す
のPythonスクリプト:
from subprocess import check_call
a = str(3)
check_call(["/home/desktop/bash2pyTest/test.sh", a], shell=False)
バッシュスクリプト:私は他のQ &を読んだ
#!/bin/bash
echo "This number was sent from the py script: " $1
このトピックに関連しているとして、しかし、私は私が概念的に理解している解決策を見出すことはできません。したがって、上記の構文は正しくない可能性があります。私は他のいくつかの方法も試みました。ただし、次のエラーが表示され続けます。
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 with exit code 1
助けていただければ幸いです。私は困惑している。