3.8 Support for the Notebook (introspection and setup)

Module: sage.server.support

Support for the Notebook (introspection and setup)

Author: William Stein (much of this code is from IPython).

Module-level Functions

completions( s, globs, [format=False], [width=90], [system=None])

Return a list of completions in the context of globs.

cython_import( filename, [verbose=False], [compile_message=False], [use_cache=False], [create_local_c_file=True])

Input:

filename
- name of a file that contains cython code

Output:
module
- the module that contains the compiled cython code.

Raises an ImportError exception if anything goes wrong.

cython_import_all( filename, globals, [verbose=False], [compile_message=False], [use_cache=False], [create_local_c_file=True])

Input:

filename
- name of a file that contains cython code

Output: changes globals using the attributes of the Cython module that do not begin with an underscore.

Raises an ImportError exception if anything goes wrong.

docstring( obj_name, globs, [system=sage])

Format obj_name's docstring for printing in Sage notebook.

Author Log:

get_rightmost_identifier( s)

help( obj)

Display help on s.

NOTE: This a wrapper around the builtin help. If formats the output as HTML without word wrap, which looks better in the notebook.

Input:

s
- Python object, module, etc.

Output: prints out help about s; it's often more more extensive than foo?

TESTS:

sage: import numpy.linalg
sage: sage.server.support.help(numpy.linalg.norm)
<html><table notracebacks bgcolor="#386074" cellpadding=10
cellspacing=10><tr><td bgcolor="#f5f5f5"><font color="#37546d">
\&nbsp;\&nbsp;\&nbsp;<a target='_new' href='cell://docs-....html'>Click to
open help window</a>\&nbsp;\&nbsp;\&nbsp;
<br></font></tr></td></table></html>

init( [object_directory=None], [globs=])

Initialize Sage for use with the web notebook interface.

load_session( v, filename, state)

save_session( filename)

setup_systems( globs)

source_code( s, globs, [system=sage])

Format obj's source code for printing in Sage notebook.

Author Log:

syseval( system, cmd, [dir=None])

tabulate( v, [width=90], [ncols=3])

variables( [with_types=True])

See About this document... for information on suggesting changes.