当前位置: 首页>>代码示例>>Python>>正文


Python inprocess.QtInProcessKernelManager方法代码示例

本文整理汇总了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) 
开发者ID:CadQuery,项目名称:CQ-editor,代码行数:27,代码来源:console.py

示例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) 
开发者ID:mjhoptics,项目名称:ray-optics,代码行数:21,代码来源:ipyconsole.py

示例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) 
开发者ID:CountryTk,项目名称:Hydra,代码行数:18,代码来源:IPythonWidget.py

示例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) 
开发者ID:cortex-lab,项目名称:phy,代码行数:21,代码来源:widgets.py

示例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) 
开发者ID:AOtools,项目名称:soapy,代码行数:18,代码来源:jupyterconsolewidget.py

示例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() 
开发者ID:jupyter,项目名称:qtconsole,代码行数:18,代码来源:inprocess_qtconsole.py

示例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) 
开发者ID:angr,项目名称:angr-management,代码行数:23,代码来源:qipython_widget.py

示例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) 
开发者ID:SanPen,项目名称:GridCal,代码行数:22,代码来源:jupyter_console_ABC_bug.py

示例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) 
开发者ID:Tooblippe,项目名称:pandapower_gui,代码行数:18,代码来源:pandapower_gui.py

示例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() 
开发者ID:iris-edu,项目名称:pyweed,代码行数:11,代码来源:ConsoleDialog.py

示例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() 
开发者ID:mmolero,项目名称:pcloudpy,代码行数:12,代码来源:IPythonConsole.py

示例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("") 
开发者ID:AOtools,项目名称:soapy,代码行数:44,代码来源:gui.py


注:本文中的qtconsole.inprocess.QtInProcessKernelManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。