code: def write_to_output(content, output=None,
                      encoding=anytemplate.compat.ENCODING):
      
      if anytemplate.compat.IS_PYTHON_3 and isinstance(content, bytes):
          content = str(content, encoding)
  
      if output and not output == '-':
          _write_to_filepath(content, output)
      elif anytemplate.compat.IS_PYTHON_3:
          print(content)
      else:
          print(content.encode(encoding.lower()), file=get_output_stream())
docs: :param content: Content string to write to
      :param output: Output destination
      :param encoding: Character set encoding of outputs