當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。