code: def read_pipe(pipe_out):
      
      out = b''
      while more_data(pipe_out):
          out += os.read(pipe_out, 1024)
  
      return out.decode('utf-8')
docs: Read data on a pipe
  
      Used to capture stdout data produced by libiperf
  
      :param pipe_out: The os pipe_out
      :rtype: unicode string