i hava a small python3 code. I want to use multiple variables in subprocess.run
import subprocess
scripts_home='/usr/local/bin'
script_argument = 'argument'
def function():
subprocess.run("script_home/script.sh %s" % script_argument, shell=True, capture_output=True).stdout
how can i use script_home variable in command ?
I will already tried:
subprocess.run("%s/script.sh %s" % script_home % script_argument, shell=True, capture_output=True).stdout
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: not enough arguments for format string