Do this:
from subprocess import call
call(["sh", "caminho_do_script.sh", temp, umid])
You will need to use list
. The first item of this list is the command, and the rest of the arguments.
In the example above, it's as if I have been calling directly 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, such as 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 response from Stackoverflow English