fd_redirector.py 文件源码

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

项目:human-rl 作者: gsastry 项目源码 文件源码
def stop(self):
        """ Unset the redirection and return the captured output.
        """
        if self.started:
            self.flush()
            os.dup2(self.oldhandle, self.fd)
            os.close(self.oldhandle)
            f = os.fdopen(self.piper, 'r')
            output = f.read()
            f.close()

            self.started = False
            return output
        else:
            return ''
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号