Use Popen.wait:
process = subprocess.Popen(["your_cmd"]...)
process.wait()
Or check_output, check_call which all wait for the return code depending on what you want to do and the version of python.
If you are using python >= 2.7 and you don't care about the output just use check_call
.
You can also use call but that will not raise any error if you have a non-zero return code which may or may not be desirable