I am trying to run a .sh script from python.
I saw that this can be done in various ways such as:
import subprocess
subprocess.call(["./test.sh"])
or
import os
os.system("sh test.sh")
However this assumes that test.sh is in the same folder where you are running the script from. What if I want to run the .sh which is in a specific folder?
I tried the following but with no luck:
import subprocess
subprocess.call(["cd ~/ros_ws", "./intera.sh"])
import subprocess
subprocess.call(["cd ~/ros_ws", "./intera.sh"], shell=True)
Thanks for the help.