Exemplo n.º 1
0
        Return a unicode representation of ``self``.

        EXAMPLES::

            sage: i = var('i')
            sage: ua = unicode_art(sum(pi^i/factorial(i)*x^i, i, 0, oo))
            sage: str(ua)
            ' \u03c0\u22c5x\n\u212f   '
        """
        return repr(self).decode("utf-8")


_unicode_art_factory = CharacterArtFactory(
    UnicodeArt,
    str,
    '_unicode_art_',
    (symbol.unicode_left_parenthesis, symbol.unicode_right_parenthesis),
    (symbol.unicode_left_square_bracket, symbol.unicode_right_square_bracket),
    (symbol.unicode_left_curly_brace, symbol.unicode_right_curly_brace),
)

empty_unicode_art = _unicode_art_factory.build_empty()


def unicode_art(*obj, **kwds):
    r"""
    Return an unicode art representation

    INPUT:


    - ``*obj`` -- any number of positional arguments, of arbitrary
Exemplo n.º 2
0
        Return a unicode representation of ``self``.

        EXAMPLES::

            sage: i = var('i')
            sage: ua = unicode_art(sum(pi^i/factorial(i)*x^i, i, 0, oo))
            sage: unicode(ua)  # py2
            u' \u03c0\u22c5x\n\u212f   '
            sage: str(ua)  # py3
            ' \u03c0\u22c5x\n\u212f   '
        """
        return repr(self).decode("utf-8")

_unicode_art_factory = CharacterArtFactory(
    UnicodeArt, text_type, '_unicode_art_',
    (symbol.unicode_left_parenthesis, symbol.unicode_right_parenthesis),
    (symbol.unicode_left_square_bracket, symbol.unicode_right_square_bracket),
    (symbol.unicode_left_curly_brace, symbol.unicode_right_curly_brace),
)


empty_unicode_art = _unicode_art_factory.build_empty()


def unicode_art(*obj, **kwds):
    r"""
    Return an unicode art representation

    INPUT:


    - ``*obj`` -- any number of positional arguments, of arbitrary
Exemplo n.º 3
0
    - ``baseline`` -- the reference line (from the bottom)

    EXAMPLES::

        sage: i = var('i')
        sage: ascii_art(sum(pi^i/factorial(i)*x^i, i, 0, oo))
         pi*x
        e
    """
    _string_type = str


_ascii_art_factory = CharacterArtFactory(
    AsciiArt, str, '_ascii_art_',
    (symbol.ascii_left_parenthesis, symbol.ascii_right_parenthesis),
    (symbol.ascii_left_square_bracket, symbol.ascii_right_square_bracket),
    (symbol.ascii_left_curly_brace, symbol.ascii_right_curly_brace),
)


empty_ascii_art = _ascii_art_factory.build_empty()


def ascii_art(*obj, **kwds):
    r"""
    Return an ASCII art representation

    INPUT:

    - ``*obj`` -- any number of positional arguments, of arbitrary
      type. The objects whose ascii art representation we want.
Exemplo n.º 4
0
    - ``baseline`` -- the reference line (from the bottom)

    EXAMPLES::

        sage: i = var('i')
        sage: ascii_art(sum(pi^i/factorial(i)*x^i, i, 0, oo))
         pi*x
        e
    """
    _string_type = str



_ascii_art_factory = CharacterArtFactory(
    AsciiArt, str, '_ascii_art_',
    (symbol.ascii_left_parenthesis, symbol.ascii_right_parenthesis),
    (symbol.ascii_left_square_bracket, symbol.ascii_right_square_bracket),
    (symbol.ascii_left_curly_brace, symbol.ascii_right_curly_brace),
)


empty_ascii_art = _ascii_art_factory.build_empty()


def ascii_art(*obj, **kwds):
    r"""
    Return an ASCII art representation

    INPUT:

    - ``*obj`` -- any number of positional arguments, of arbitrary
      type. The objects whose ascii art representation we want.