I am executing a bash script using subprocess
module.
subprocess.call(['temp.sh'])
As per python if the temp.sh
file is present it calls the script and it doesn't worry about the success or failure of temp.sh
. I want to capture the exit code of temp.sh
in order to proceed further with rest of my python script.
os.system
is deprecated. Usesubprocess
instead. – BlueManCZ Sep 16 '20 at 11:25.sh
at end of files names. It is bad practice, consider what would have to change if you re-wrote the script in python. – ctrl-alt-delor Sep 16 '20 at 13:07