2
나는/dev/null을 열어서 stout을 그것에 리다이렉트하는 리눅스 해결책을 안다.
(Prevent subprocess of subprocess from writing to stdout 또는 그와 유사한 것)
Windows의 솔루션은 무엇입니까?윈도우에서 서브 프로세스의 표준 출력을 숨기는 방법
나는/dev/null을 열어서 stout을 그것에 리다이렉트하는 리눅스 해결책을 안다.
(Prevent subprocess of subprocess from writing to stdout 또는 그와 유사한 것)
Windows의 솔루션은 무엇입니까?윈도우에서 서브 프로세스의 표준 출력을 숨기는 방법
동일한 방법을 사용하지만 휴대형 솔루션 인 os.devnull
을 사용하십시오. Windows에서는이 출력을 NUL
으로 보냅니다.
with open(os.devnull, 'w') as tempf:
proc = Popen(cmd, stdout=tempf, stderr=tempf)
proc.communicate()
:
사실은,이 솔루션은 이미 질문에 추천 당신은 연결