나는 다음과 같은 코드가 있습니다파이썬 하위 프로세스는 popen nohup을 반환 코드
argpass = ['nohup']
argpass.append('/path/to/script')
log_output_err = open(log_file,'a+')
out = subprocess.Popen(argpass,
stdout = log_output_err,
stderr = log_output_err)
#if the script fails I need to have some logic here...
난 그냥에/스크립트/경로의 리턴 코드를/얻을 수있는 방법 궁금합니다.
아마도/path/to/script에 논리를 삽입해야 할 필요가 있습니다. subprocess.Popen
객체가 returncode
을 가지고