作者kmkh (kmkh)
看板Python
标题Re: [问题subprocess的的stdout PIPE被占住
时间Tue Jul 17 15:41:37 2012
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