[ACCEPTED]-Inside python code, how do I run a .sh script?-shell
Using subprocess.call is the easiest way. It will not return 3 until the executed program has terminated. Have 2 a look at the other methods of the subprocess module if you 1 need different behaviour.
import os os.system('./script.sh')
python script won't stop until sh is finished
You can use
subprocess.call but when using subprocess 4 methods make sure you use
shell=True. And executing 3 it via system call in all these methods 2 is blocking. The python script will complete 1 and then go the next step.
More Related questions