PYTHON

python shell command

고요한하늘... 2012. 11. 7. 13:22


shell script를 실행시키고 해당 스크립트를 실행한 process가 끝나길 기다릴때 proc.wait()를 사용


command="ls -al"

proc = subprocess.Popen( command, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE )

                        return_code = proc.wait()

                        if return_code == 0 :


'PYTHON' 카테고리의 다른 글

python option  (0) 2012.11.07
python option  (0) 2012.11.07
python logging  (0) 2012.11.07
undefined symbol: Py_InitModule4TraceRefs_64   (0) 2011.05.17
파이선 파일 관련 함수  (0) 2008.09.18