本文整理匯總了Python中qtconsole.rich_jupyter_widget.RichJupyterWidget方法的典型用法代碼示例。如果您正苦於以下問題:Python rich_jupyter_widget.RichJupyterWidget方法的具體用法?Python rich_jupyter_widget.RichJupyterWidget怎麽用?Python rich_jupyter_widget.RichJupyterWidget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qtconsole.rich_jupyter_widget
的用法示例。
在下文中一共展示了rich_jupyter_widget.RichJupyterWidget方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: initialize
# 需要導入模塊: from qtconsole import rich_jupyter_widget [as 別名]
# 或者: from qtconsole.rich_jupyter_widget import RichJupyterWidget [as 別名]
def initialize(self, argv=None):
self.init_qt_app()
super(JupyterQtConsoleApp, self).initialize(argv)
if self._dispatching:
return
# handle deprecated renames
for old_name, new_name in [
('IPythonQtConsoleApp', 'JupyterQtConsole'),
('IPythonWidget', 'JupyterWidget'),
('RichIPythonWidget', 'RichJupyterWidget'),
]:
cfg = self._deprecate_config(self.config, old_name, new_name)
if cfg:
self.update_config(cfg)
JupyterConsoleApp.initialize(self,argv)
self.init_qt_elements()
self.init_signal()
示例2: __init__
# 需要導入模塊: from qtconsole import rich_jupyter_widget [as 別名]
# 或者: from qtconsole.rich_jupyter_widget import RichJupyterWidget [as 別名]
def __init__(self):
# Create an in-process kernel
self.kernel_manager = QtInProcessKernelManager()
self.kernel_manager.start_kernel()
self.kernel = self.kernel_manager.kernel
self.kernel_client = self.kernel_manager.client()
self.kernel_client.start_channels()
control = RichIPythonWidget()
control.kernel_manager = self.kernel_manager
control.kernel_client = self.kernel_client
control.exit_requested.connect(self.stop)
self.setCentralWidget(control)
示例3: initialize
# 需要導入模塊: from qtconsole import rich_jupyter_widget [as 別名]
# 或者: from qtconsole.rich_jupyter_widget import RichJupyterWidget [as 別名]
def initialize(self, argv=None):
self._init_asyncio_patch()
self.init_qt_app()
super(JupyterQtConsoleApp, self).initialize(argv)
if self._dispatching:
return
# handle deprecated renames
for old_name, new_name in [
('IPythonQtConsoleApp', 'JupyterQtConsole'),
('IPythonWidget', 'JupyterWidget'),
('RichIPythonWidget', 'RichJupyterWidget'),
]:
cfg = self._deprecate_config(self.config, old_name, new_name)
if cfg:
self.update_config(cfg)
JupyterConsoleApp.initialize(self,argv)
self.init_qt_elements()
self.init_signal()
示例4: show
# 需要導入模塊: from qtconsole import rich_jupyter_widget [as 別名]
# 或者: from qtconsole.rich_jupyter_widget import RichJupyterWidget [as 別名]
def show():
global ipython_widget # Prevent from being garbage collected
# Create an in-process kernel
kernel_manager = QtInProcessKernelManager()
kernel_manager.start_kernel(show_banner=False)
kernel = kernel_manager.kernel
kernel.gui = 'qt4'
kernel_client = kernel_manager.client()
kernel_client.start_channels()
ipython_widget = RichJupyterWidget()
ipython_widget.kernel_manager = kernel_manager
ipython_widget.kernel_client = kernel_client
ipython_widget.show()
示例5: closeEvent
# 需要導入模塊: from qtconsole import rich_jupyter_widget [as 別名]
# 或者: from qtconsole.rich_jupyter_widget import RichJupyterWidget [as 別名]
def closeEvent(self, event):
"""Clean up the integrated console in napari."""
if self.kernel_client is not None:
self.kernel_client.stop_channels()
if self.kernel_manager is not None and self.kernel_manager.has_kernel:
self.kernel_manager.shutdown_kernel()
# RichJupyterWidget doesn't clean these up
self._completion_widget.deleteLater()
self._call_tip_widget.deleteLater()
self.deleteLater()
event.accept()
示例6: _plain_changed
# 需要導入模塊: from qtconsole import rich_jupyter_widget [as 別名]
# 或者: from qtconsole.rich_jupyter_widget import RichJupyterWidget [as 別名]
def _plain_changed(self, name, old, new):
kind = 'plain' if new else 'rich'
self.config.ConsoleWidget.kind = kind
if new:
self.widget_factory = JupyterWidget
else:
self.widget_factory = RichJupyterWidget
# the factory for creating a widget
示例7: make_jupyter_widget_with_kernel
# 需要導入模塊: from qtconsole import rich_jupyter_widget [as 別名]
# 或者: from qtconsole.rich_jupyter_widget import RichJupyterWidget [as 別名]
def make_jupyter_widget_with_kernel():
"""Start a kernel, connect to it, and create a RichJupyterWidget to use it
"""
kernel_manager = QtKernelManager(kernel_name=USE_KERNEL)
kernel_manager.start_kernel()
kernel_client = kernel_manager.client()
kernel_client.start_channels()
jupyter_widget = RichJupyterWidget()
jupyter_widget.kernel_manager = kernel_manager
jupyter_widget.kernel_client = kernel_client
return jupyter_widget
示例8: __init__
# 需要導入模塊: from qtconsole import rich_jupyter_widget [as 別名]
# 或者: from qtconsole.rich_jupyter_widget import RichJupyterWidget [as 別名]
def __init__(self, layout, sim, gui):
# Create an in-process kernel
self.kernel_manager = QtInProcessKernelManager()
# self.kernel_manager = QtKernelManager()
self.kernel_manager.start_kernel()
self.kernel = self.kernel_manager.kernel
# self.kernel.shell.write("Welcome to AO Sim!\n")
config = sim.config
#Pass some useful objects to the user
usefulObjects = { "sim" : sim,
"gui" : gui,
"config" : config,
"simConfig" : sim.config.sim,
"telConfig" : sim.config.tel,
"atmosConfig" : sim.config.atmos,
"np" : numpy,
"plt" : pyplot
}
for i in range(sim.config.sim.nGS):
usefulObjects["wfs{}Config".format(i)] = sim.config.wfss[i]
for i in range(sim.config.sim.nDM):
usefulObjects["dm{}Config".format(i)] = sim.config.dms[i]
for i in range(sim.config.sim.nSci):
usefulObjects["sci{}Config".format(i)] = sim.config.scis[i]
self.kernel.shell.push(usefulObjects)
self.kernel_client = self.kernel_manager.client()
self.kernel_client.start_channels()
control = RichIPythonWidget()
control.kernel_manager = self.kernel_manager
control.kernel_client = self.kernel_client
control.exit_requested.connect(self.stop)
layout.addWidget(control)
# self.kernel.shell.ex("")