当我嵌入此函数时:
def RunCommand(self, command):
try:
p = subprocess.Popen(command)
stdout,stderr = p.communicate()
except OSError, e: raise RuntimeError, "Error while executing: '%s': %s" % (" ".join( cmd ),e,)
当我的代码是类中的函数时,它会延迟。在
如果我移除类,在interpeter中或者没有类控制它的情况下执行命令,它会毫不延迟地执行命令。在
这个类是因为某种原因导致它等待或挂起吗?在
我也注意到同样的事情发生在os.popen公司我测试它只是为了看看它是否是子进程模块
目前没有回答
相关问题 更多 >
编程相关推荐