code: def poutput(self, msg: Any, end: str = '\n', color: str = '') -> None:
          
          if msg is not None and msg != '':
              try:
                  msg_str = '{}'.format(msg)
                  if not msg_str.endswith(end):
                      msg_str += end
                  if color:
                      msg_str = color + msg_str + Fore.RESET
                  self.decolorized_write(self.stdout, msg_str)
              except BrokenPipeError:
                  # This occurs if a command's output is being piped to another
                  # process and that process closes before the command is
                  # finished. If you would like your application to print a
                  # warning message, then set the broken_pipe_warning attribute
                  # to the message you want printed.
                  if self.broken_pipe_warning:
                      sys.stderr.write(self.broken_pipe_warning)
docs: Smarter self.stdout.write(); color aware and adds newline of not present.
  
          Also handles BrokenPipeError exceptions for when a commands's output has
          been piped to another process and that process terminates before the
          cmd2 command is finished executing.
  
          :param msg: message to print to current stdout (anything convertible to a str with '{}'.format() is OK)
          :param end: (optional) string appended after the end of the message if not already present, default a newline
          :param color: (optional) color escape to output this message with