本文整理汇总了Python中qtconsole.inprocess.QtInProcessKernelManager方法的典型用法代码示例。如果您正苦于以下问题:Python inprocess.QtInProcessKernelManager方法的具体用法?Python inprocess.QtInProcessKernelManager怎么用?Python inprocess.QtInProcessKernelManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtconsole.inprocess
的用法示例。
在下文中一共展示了inprocess.QtInProcessKernelManager方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [as 别名]
def __init__(self, customBanner=None, namespace=dict(), *args, **kwargs):
super(ConsoleWidget, self).__init__(*args, **kwargs)
# if not customBanner is None:
# self.banner = customBanner
self.font_size = 6
self.kernel_manager = kernel_manager = QtInProcessKernelManager()
kernel_manager.start_kernel(show_banner=False)
kernel_manager.kernel.gui = 'qt'
kernel_manager.kernel.shell.banner1 = ""
self.kernel_client = kernel_client = self._kernel_manager.client()
kernel_client.start_channels()
def stop():
kernel_client.stop_channels()
kernel_manager.shutdown_kernel()
QApplication.instance().exit()
self.exit_requested.connect(stop)
self.clear()
self.push_vars(namespace)
示例2: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [as 别名]
def __init__(self, customBanner=None, *args, **kwargs):
super().__init__(*args, **kwargs)
if customBanner is not None:
self.banner = customBanner
self.font_size = 6
self.kernel_manager = kernel_manager = QtInProcessKernelManager()
kernel_manager.start_kernel(show_banner=False)
kernel_manager.kernel.gui = 'qt'
self.kernel_client = kernel_client = self.kernel_manager.client()
kernel_client.start_channels()
def stop():
kernel_client.stop_channels()
kernel_manager.shutdown_kernel()
guisupport.get_app_qt().exit()
self.exit_requested.connect(stop)
示例3: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [as 别名]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.font_size = 12
self.kernel_manager = kernel_manager = QtInProcessKernelManager()
kernel_manager.start_kernel(show_banner=False)
kernel_manager.kernel.gui = "qt"
self.kernel_client = kernel_client = self._kernel_manager.client()
kernel_client.start_channels()
def stop():
kernel_client.stop_channels()
kernel_manager.shutdown_kernel()
sys.exit()
self.exit_requested.connect(stop)
示例4: start_kernel
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [as 别名]
def start_kernel(self):
"""Start the IPython kernel."""
logger.debug("Starting the kernel.")
self.kernel_manager = QtInProcessKernelManager()
self.kernel_manager.start_kernel(show_banner=False)
self.kernel_manager.kernel.gui = 'qt'
self.kernel = self.kernel_manager.kernel
self.shell = self.kernel.shell
try:
self.kernel_client = self.kernel_manager.client()
self.kernel_client.start_channels()
except Exception as e: # pragma: no cover
logger.error("Could not start IPython kernel: %s.", str(e))
self.set_default_style('linux')
self.exit_requested.connect(self.stop)
示例5: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [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)
示例6: show
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [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()
示例7: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [as 别名]
def __init__(self, banner=None, namespace=None, *args, **kwargs):
if banner is not None:
self.banner = banner
RichJupyterWidget.__init__(self, *args, **kwargs)
self.kernel_manager = kernel_manager = QtInProcessKernelManager()
kernel_manager.start_kernel()
kernel_manager.kernel.gui = 'qt4'
if namespace is not None:
self.push_namespace(namespace)
self.kernel_client = kernel_client = self._kernel_manager.client()
kernel_client.start_channels()
def stop():
kernel_client.stop_channels()
kernel_manager.shutdown_kernel()
guisupport.get_app_qt4().exit()
self.exit_requested.connect(stop)
示例8: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [as 别名]
def __init__(self, customBanner=None, *args, **kwargs):
RichJupyterWidget.__init__(self, *args, **kwargs)
if customBanner is not None:
self.banner = customBanner
self.font_size = 6
self.gui_completion = 'droplist'
self.kernel_manager = QtInProcessKernelManager()
self.kernel_manager.start_kernel(show_banner=False)
self.kernel_manager.kernel.gui = 'qt'
self.kernel_client = kernel_client = self._kernel_manager.client()
kernel_client.start_channels()
def stop():
kernel_client.stop_channels()
self.kernel_manager.shutdown_kernel()
# guisupport.get_app_qt().exit()
self.exit_requested.connect(stop)
示例9: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [as 别名]
def __init__(self, customBanner=None, *args, **kwargs):
if customBanner != None:
self.banner = customBanner
super(QIPythonWidget, self).__init__(*args, **kwargs)
self.kernel_manager = kernel_manager = QtInProcessKernelManager()
kernel_manager.start_kernel()
kernel_manager.kernel.gui = 'qt4'
self.kernel_client = kernel_client = self._kernel_manager.client()
kernel_client.start_channels()
def stop():
"stop"
kernel_client.stop_channels()
kernel_manager.shutdown_kernel()
guisupport.get_app_qt4().exit()
self.exit_requested.connect(stop)
示例10: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [as 别名]
def __init__(self, **kwarg):
super(RichIPythonWidget, self).__init__()
self.kernel_manager = QtInProcessKernelManager()
self.kernel_manager.start_kernel()
self.kernel = self.kernel_manager.kernel
self.kernel.gui = 'qt4'
self.kernel.shell.push(kwarg)
self.kernel_client = self.kernel_manager.client()
self.kernel_client.start_channels()
示例11: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [as 别名]
def __init__(self, **kwarg):
super(RichIPythonWidget, self).__init__()
self.app = app = guisupport.get_app_qt4()
self.kernel_manager = QtInProcessKernelManager()
self.kernel_manager.start_kernel()
self.kernel = self.kernel_manager.kernel
self.kernel.gui = 'qt4'
self.kernel.shell.push(kwarg)
self.kernel_client = self.kernel_manager.client()
self.kernel_client.start_channels()
示例12: __init__
# 需要导入模块: from qtconsole import inprocess [as 别名]
# 或者: from qtconsole.inprocess import QtInProcessKernelManager [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("")