当前位置: 首页>>代码示例>>Python>>正文


Python popen2.Popen4方法代码示例

本文整理汇总了Python中popen2.Popen4方法的典型用法代码示例。如果您正苦于以下问题:Python popen2.Popen4方法的具体用法?Python popen2.Popen4怎么用?Python popen2.Popen4使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在popen2的用法示例。


在下文中一共展示了popen2.Popen4方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: exec_command

# 需要导入模块: import popen2 [as 别名]
# 或者: from popen2 import Popen4 [as 别名]
def exec_command(cmd, ok_return_value=0, combine_error=False):
        """
        Run given command, check return value, and return
        concatenated stdout and stderr.
        """
        
        # XXX: unix-only!

        try:
            p = popen2.Popen4(cmd, True)
            p.tochild.close()
            returncode = p.wait() >> 8
            out = p.fromchild.read()
        except OSError, e:
            raise RuntimeError("Command %s failed: %s" % (' '.join(cmd), e)) 
开发者ID:fsmMLK,项目名称:inkscapeMadeEasy,代码行数:17,代码来源:textext.py

示例2: __init__

# 需要导入模块: import popen2 [as 别名]
# 或者: from popen2 import Popen4 [as 别名]
def __init__(self, command, **kw):
                if kw.get('stderr') == 'STDOUT':
                    popen2.Popen4.__init__(self, command, 1)
                else:
                    popen2.Popen3.__init__(self, command, 1)
                self.stdin = self.tochild
                self.stdout = self.fromchild
                self.stderr = self.childerr 
开发者ID:turbulenz,项目名称:gyp,代码行数:10,代码来源:TestCmd.py

示例3: __init__

# 需要导入模块: import popen2 [as 别名]
# 或者: from popen2 import Popen4 [as 别名]
def __init__(self, command, **kw):
                if kw.get('stderr') == 'STDOUT':
                    apply(popen2.Popen4.__init__, (self, command, 1))
                else:
                    apply(popen2.Popen3.__init__, (self, command, 1))
                self.stdin = self.tochild
                self.stdout = self.fromchild
                self.stderr = self.childerr 
开发者ID:kawalpemilu,项目名称:kawalpemilu2014,代码行数:10,代码来源:TestCmd.py

示例4: __init__

# 需要导入模块: import popen2 [as 别名]
# 或者: from popen2 import Popen4 [as 别名]
def __init__(self, cmd, bufsize=-1, shell=True, close_fds=True,
                        stdin=PIPE, stdout=PIPE, stderr=STDOUT, **kwargs):

            super(Popen4, self).__init__(cmd, bufsize=bufsize, shell=shell,
                            close_fds=close_fds, stdin=stdin, stdout=stdout,
                            stderr=stderr, **kwargs)

            self.tochild = self.stdin
            self.fromchild = self.stdout
            self.childerr = self.stderr 
开发者ID:binhex,项目名称:moviegrabber,代码行数:12,代码来源:CheetahWrapper.py

示例5: assertPosixSubprocess

# 需要导入模块: import popen2 [as 别名]
# 或者: from popen2 import Popen4 [as 别名]
def assertPosixSubprocess(self, cmd):
        cmd = cmd.replace('cheetah', self.cmd)
        process = Popen4(cmd, env=os.environ)
        process.tochild.close()
        output = process.fromchild.read()
        status = process.wait()
        process.fromchild.close()
        return status, output 
开发者ID:binhex,项目名称:moviegrabber,代码行数:10,代码来源:CheetahWrapper.py


注:本文中的popen2.Popen4方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。