An example of opening up an RichJupyterWidget in a PyQT Application, this can execute either stand-alone or by importing this file and calling inprocess_qtconsole.show(). Based on the earlier example in the IPython repository, this has been updated to use qtconsole.

Classes:

ConsoleWidget(**kwargs)

A console widget to access an inprocess shell

IPythonControl

A modified control to show the help of objects in the help explorer

Functions:

init_asyncio_patch()

set default asyncio policy to be compatible with tornado Tornado 6 (at least) is not compatible with the default asyncio implementation on Windows Pick the older SelectorEventLoopPolicy on Windows if the known-incompatible default policy is in use. do this as early as possible to make it a low priority and overrideable ref: https://github.com/tornadoweb/tornado/issues/2608 FIXME: if/when tornado supports the defaults in asyncio, remove and bump tornado requirement for py38.

class psyplot_gui.console.ConsoleWidget(**kwargs: Any)[source]

Bases: QtInProcessRichJupyterWidget, DockMixin

A console widget to access an inprocess shell

Methods:

close(self)

eventFilter(*args, **kwargs)

Reimplemented to ensure a console-like behavior in the underlying text widgets.

get_current_object([to_end])

Get the name of the object at cursor position

get_obj(obj_text)

Get the object from the shell specified by obj_text

run_command_in_shell(code, *args, **kwargs)

Run a script in the shell

run_script_in_shell(script)

Run a script in the shell

show_current_help([to_end, force])

Show the help of the object at the cursor position if rcParams['console.connect_to_help'] is set

update_mp(project)

Update the mp variable in the shell is rcParams['console.auto_set_mp'] with a main project

update_sp(project)

Update the sp variable in the shell is rcParams['console.auto_set_sp'] with a sub project

Classes:

custom_control

alias of IPythonControl

Attributes:

dock_position

The position of the plugin

intro_msg

rc

run_command(*args, **kwargs)

run_script(*args, **kwargs)

title

The title of the plugin

close(self) bool[source]
custom_control

alias of IPythonControl Methods:

keyPressEvent(event)

Reimplement Qt Method - Basic keypress event handler

dock_position = 2

The position of the plugin

eventFilter(*args, **kwargs)[source]

Reimplemented to ensure a console-like behavior in the underlying text widgets.

get_current_object(to_end=False)[source]

Get the name of the object at cursor position

get_obj(obj_text)[source]

Get the object from the shell specified by obj_text

Parameters:

obj_text (str) – The name of the variable as it is stored in the shell

Returns:

  • bool – True, if the object could be found

  • object or None – The requested object or None if it could not be found

intro_msg = ''
rc = {'auto_set_mp': True, 'auto_set_sp': True, 'connect_to_help': True, 'start_channels': True}
run_command(*args, **kwargs)
run_command_in_shell(code, *args, **kwargs)[source]

Run a script in the shell

run_script(*args, **kwargs)
run_script_in_shell(script)[source]

Run a script in the shell

show_current_help(to_end=False, force=False)[source]

Show the help of the object at the cursor position if rcParams['console.connect_to_help'] is set

title = 'Console'

The title of the plugin

update_mp(project)[source]

Update the mp variable in the shell is rcParams['console.auto_set_mp'] with a main project

update_sp(project)[source]

Update the sp variable in the shell is rcParams['console.auto_set_sp'] with a sub project

class psyplot_gui.console.IPythonControl[source]

Bases: QTextEdit

A modified control to show the help of objects in the help explorer

Methods:

keyPressEvent(event)

Reimplement Qt Method - Basic keypress event handler

keyPressEvent(event)[source]

Reimplement Qt Method - Basic keypress event handler

psyplot_gui.console.init_asyncio_patch()[source]

set default asyncio policy to be compatible with tornado Tornado 6 (at least) is not compatible with the default asyncio implementation on Windows Pick the older SelectorEventLoopPolicy on Windows if the known-incompatible default policy is in use. do this as early as possible to make it a low priority and overrideable ref: https://github.com/tornadoweb/tornado/issues/2608 FIXME: if/when tornado supports the defaults in asyncio,

remove and bump tornado requirement for py38