(ipython=True, quiet=False, source=None)
return message
Create a banner for an interactive session.
Create a banner for an interactive session.
Create a banner for an interactive session .
def _make_message(ipython=True, quiet=False, source=None):
    """Create a banner for an interactive session. """
    from sympy import __version__ as sympy_version
    from sympy.polys.domains import GROUND_TYPES
    from sympy.utilities.misc import ARCH
    from sympy import SYMPY_DEBUG

    import sys
    import os

    python_version = "%d.%d.%d" % sys.version_info[:3]

    if ipython:
        shell_name = "IPython"
    else:
        shell_name = "Python"

    info = ['ground types: %s' % GROUND_TYPES]

    cache = os.getenv('SYMPY_USE_CACHE')

    if cache is not None and cache.lower() == 'no':
        info.append('cache: off')

    if SYMPY_DEBUG:
        info.append('debugging: on')

    args = shell_name, sympy_version, python_version, ARCH, ', '.join(info)
    message = "%s console for SymPy %s (Python %s-%s) (%s)\n" % args

    if not quiet:
        if source is None:
            source = preexec_source

        _source = ""

        for line in source.split('\n')[:-1]:
            if not line:
                _source += '\n'
            else:
                _source += '>>> ' + line + '\n'

        message += '\n' + verbose_message % {'source': _source}

    return message
def _make_message ( ipython = True , quiet = False , source = None ) : from sympy import __version__ as sympy_version from sympy . polys . domains import GROUND_TYPES from sympy . utilities . misc import ARCH from sympy import SYMPY_DEBUG import sys import os python_version = "%d.%d.%d" % sys . version_info [ : 3 ] if ipython : shell_name = "IPython" else : shell_name = "Python" info = [ 'ground types: %s' % GROUND_TYPES ] cache = os . getenv ( 'SYMPY_USE_CACHE' ) if cache is not None and cache . lower ( ) == 'no' : info . append ( 'cache: off' ) if SYMPY_DEBUG : info . append ( 'debugging: on' ) args = shell_name , sympy_version , python_version , ARCH , ', ' . join ( info ) message = "%s console for SymPy %s (Python %s-%s) (%s)\n" % args if not quiet : if source is None : source = preexec_source _source = "" for line in source . split ( '\n' ) [ : - 1 ] : if not line : _source += '\n' else : _source += '>>> ' + line + '\n' message += '\n' + verbose_message % { 'source' : _source } return message