Do so:
from subprocess import call
call(["sh", "caminho_do_script.sh", temp, umid])
You will need to use a list
. The first item of this list is the command, and the rest, the arguments.
In the above example, it is as if I had called straight from Bash (assuming the values of temp
and umid
):
sh caminho_do_script.sh 30.6 10.2
There are several ways to do this in Python, for example using os.system
:
import os
os.system("sh caminho_do_script.sh {0:0.1f} {1:0.1f}".format(temp,umid))
If you want more options, you can take a look at this answer from Stackoverflow English
You either pass them one at a time, or multiples at a time?
– Haroldo_OK