code: def writeline(self, data, crlf="\r\n"):
          
          if self.read_thread:
              if self.read_thread.has_error():
                  raise RuntimeError("Error writing PIPE")
          # Check if process still alive
          if self.proc.poll() is not None:
              raise RuntimeError("Process stopped")
          if self.__print_io:
              self.logger.info(data, extra={'type': '-->'})
          self.proc.stdin.write(bytearray(data + crlf, 'ascii'))
          self.proc.stdin.flush()
docs: Writeline implementation.
  
          :param data: Data to write
          :param crlf: Line end characters, defailt is \r\n
          :return: Nothing
          :raises: RuntimeError if errors happen while writing to PIPE or process stops.