process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
process.wait()
print(process.returncode)
Launch a shell command with in a python script, wait for the termination and return to the script