The Sage ZMQ Kernel - The Sage Command Line

Skip to content
Back to top
View this page
Edit this page

# The Sage ZMQ Kernel

Version of the Jupyter kernel when running Sage inside the Jupyter notebook or remote Jupyter sessions.

class sage.repl.ipython_kernel.kernel.SageKernel(**kwargs: Any)

  Bases: `IPythonKernel`

  The Sage Jupyter Kernel.

  INPUT:

  See the Jupyter documentation.

  EXAMPLES:

  Sage

      sage: from sage.repl.ipython_kernel.kernel import SageKernel
      sage: SageKernel.__new__(SageKernel)
      <sage.repl.ipython_kernel.kernel.SageKernel object at 0x...>

  Python

      >>> from sage.all import *
      >>> from sage.repl.ipython_kernel.kernel import SageKernel
      >>> SageKernel.__new__(SageKernel)
      <sage.repl.ipython_kernel.kernel.SageKernel object at 0x...>

  property banner

    The Sage Banner.

    The value of this property is displayed in the Jupyter notebook.

    OUTPUT: string

    EXAMPLES:

    Sage

        sage: from sage.repl.ipython_kernel.kernel import SageKernel
        sage: sk = SageKernel.__new__(SageKernel)
        sage: print(sk.banner)
        ┌...SageMath version...

    Python

        >>> from sage.all import *
        >>> from sage.repl.ipython_kernel.kernel import SageKernel
        >>> sk = SageKernel.__new__(SageKernel)
        >>> print(sk.banner)
        ┌...SageMath version...

  property help_links

    Help in the Jupyter Notebook.

    OUTPUT: see the Jupyter documentation

    EXAMPLES:

    Sage

        sage: from sage.repl.ipython_kernel.kernel import SageKernel
        sage: sk = SageKernel.__new__(SageKernel)
        sage: sk.help_links
        [{'text': 'Sage Documentation',
          'url': '.../html/en/index.html'},
         ...]

    Python

        >>> from sage.all import *
        >>> from sage.repl.ipython_kernel.kernel import SageKernel
        >>> sk = SageKernel.__new__(SageKernel)
        >>> sk.help_links
        [{'text': 'Sage Documentation',
          'url': '.../html/en/index.html'},
         ...]

  implementation: str = 'sage'
  implementation_version: str = '10.8'
  pre_handler_hook()

    Restore the signal handlers to their default values at Sage startup, saving the old handler at the `saved_sigint_handler` attribute. This is needed because Jupyter needs to change the `SIGINT` handler.

    See Issue #19135.

  shell_class

    A trait whose value must be a subclass of a specified class.

class sage.repl.ipython_kernel.kernel.SageZMQInteractiveShell(**kwargs: Any)

  Bases: `SageNotebookInteractiveShell`, `ZMQInteractiveShell`