Sep-14-2017, 05:08 AM
Hi, I am trying to run more than 5 or 6 shell commands from my pyhton script.
Currently my psuedo code is below.
Currently my psuedo code is below.
try:
_ = subprocess.check_output(cmd1, shell=True, stderr=subprocess.STDOUT)
_ = subprocess.check_output(cmd2, shell=True, stderr=subprocess.STDOUT)
_ = subprocess.check_output(cmd3, shell=True, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
print(e.returncode)Can someone correct me if this is not right way to do? Thanks.
