Use subprocess.check_output() instead of subprocess.Popen