Jupyter Shell (xonsh.jupyter_shell)

An interactive shell for the Jupyter kernel.

class xonsh.jupyter_shell.JupyterShell(*args, **kwargs)[source]

A shell for the Jupyter kernel.

default(self, line, kernel, parent_header=None)[source]

Executes code, but redirects output to Jupyter client

class xonsh.jupyter_shell.StdJupyterRedirect(name, kernel, parent_header=None)[source]

Redirects a standard I/O stream to the Jupyter kernel.

Parameters
namestr

The name of the buffer in the sys module, e.g. ‘stdout’.

kernelXonshKernel

Instance of a Jupyter kernel

parent_headerdict or None, optional

parent header information to pass along with the kernel

close(self)[source]

Restores the original std stream.

detach(self)[source]

This operation is not supported.

fileno(self)[source]

Tunnel fileno() calls to the std stream.

flush(self)[source]

Flushes kernel iopub_stream.

read(self, size=None)[source]

Read from the stream

readline(self, size=-1)[source]

Read a line.

seek(self, offset, whence=0)[source]

Seek to a location.

truncate(self, size=None)[source]

Truncate the streams.

write(self, s)[source]

Writes data to the original kernel stream.

property encoding

The encoding of the stream

property errors

The encoding errors of the stream

property newlines

The newlines of the standard buffer.

class xonsh.jupyter_shell.StdJupyterRedirectBuf(redirect)[source]

Redirects standard I/O buffers to the Jupyter kernel.

fileno(self)[source]

Returns the file descriptor of the std buffer.

readinto(self, b)[source]

Read bytes into buffer from both streams.

seek(self, offset, whence=0)[source]

Sets the location in both the stdbuf and the membuf.

truncate(self, size=None)[source]

Truncate both buffers.

write(self, b)[source]

Write bytes to kernel.