本文整理匯總了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("")