enaml.widgets.ipython_console

Classes

IPythonConsole

A widget which hosts an embedded IPython console.

class enaml.widgets.ipython_console.IPythonConsole(parent=None, **kwargs)[source]

Bases: enaml.widgets.control.Control

A widget which hosts an embedded IPython console.

initial_ns

The initial namespace to apply to the console. Runtime changes to this value will be ignored. Use ‘update_ns’ to add variables to the console at runtime.

exit_requested

An event fired when the user invokes a console exit command.

hug_width

The ipython console expands freely by default.

proxy

A reference to the ProxyIPythonConsole object.

get_var(name, default=None)[source]

Get a variable from the console namespace.

Parameters
  • name (basestring) – The name of the variable to retrieve.

  • default (object, optional) – The value to return if the variable does not exist. The default is None.

Returns

result – The variable in the namespace, or the provided default.

Return type

object

update_ns(**kwargs)[source]

Update the variables in the console namespace.

Parameters

**kwargs – The variables to update in the console namespace.