pforma_io.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:PH5 作者: PIC-IRIS 项目源码 文件源码
def run_simple (self, cmds, x, family) :
        '''
            Run a single command in a subprocess. Line buffer output.
            cmds   -> A list of commands to be run for this family
            x      -> The sequence of the command to run
            family -> The family that goes with these commands
            pee    -> The process
            fifofh -> File handle to fifo
        '''
        pee = None
        try :
            cmd = cmds[x]
        except IndexError :
            return pee, None

        #fifo = os.path.join ("/tmp", "fifo{0}".format (family))
        #if not os.path.exists (fifo) :
            #os.mkfifo (fifo)

        #fifofh = open (fifo, mode='rw+')

        pee = subprocess.Popen (cmd,
                                shell=True,
                                bufsize=1,
                                cwd=os.path.join (self.home, family),
                                stdout=subprocess.PIPE,
                                universal_newlines=True,
                                close_fds=ON_POSIX)
        fifofh = pee.stdout

        return pee, fifofh
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号