Re: [問題subprocess的的stdout PIPE被佔住
from "http://docs.python.org/library/subprocess.html"
Note Do not use stdout=PIPE or stderr=PIPE with this function. As the pipes
are not being read in the current process, the child process may block if it
generates enough output to a pipe to fill up the OS pipe buffer.
...
ubprocess.PIPE
Special value that can be used as the stdin, stdout or stderr argument to
Popen and indicates that a pipe to the standard stream should be opened.
※ 引述《guestone (抹茶拿鐵)》之銘言:
: 想請問大家我想用subprocess去執行一外部指令
: 並用stdout.PIPE去接回傳
: 但今天如果指令執行不成功 沒有return控制權而一直佔住stdout.PIPE
: 讓我無法用stdout.read()得到回去做判斷分析傳怎麼辦??
: 有沒有什麼好的解決方法?
: 感謝~
: 以下是我用的指令
: -------------------------
: http://dpaste.com/761489/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.137.89
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):