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


Python QtKernelManager.load_connection_file方法代码示例

本文整理汇总了Python中IPython.frontend.qt.kernelmanager.QtKernelManager.load_connection_file方法的典型用法代码示例。如果您正苦于以下问题:Python QtKernelManager.load_connection_file方法的具体用法?Python QtKernelManager.load_connection_file怎么用?Python QtKernelManager.load_connection_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPython.frontend.qt.kernelmanager.QtKernelManager的用法示例。


在下文中一共展示了QtKernelManager.load_connection_file方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _init_kernel_manager

# 需要导入模块: from IPython.frontend.qt.kernelmanager import QtKernelManager [as 别名]
# 或者: from IPython.frontend.qt.kernelmanager.QtKernelManager import load_connection_file [as 别名]
 def _init_kernel_manager(self):
     connection_file = find_connection_file(self.app.connection_file)
     manager = QtKernelManager(connection_file=connection_file)
     manager.load_connection_file()
     manager.start_channels()
     atexit.register(manager.cleanup_connection_file)
     self.kernel_manager = manager
开发者ID:eteq,项目名称:glue,代码行数:9,代码来源:terminal.py

示例2: default_manager

# 需要导入模块: from IPython.frontend.qt.kernelmanager import QtKernelManager [as 别名]
# 或者: from IPython.frontend.qt.kernelmanager.QtKernelManager import load_connection_file [as 别名]
def default_manager(kernel):
    connection_file = find_connection_file(kernel.connection_file)
    manager = QtKernelManager(connection_file=connection_file)
    manager.load_connection_file()
    manager.start_channels()
    atexit.register(manager.cleanup_connection_file)
    return manager
开发者ID:rseed42,项目名称:templates,代码行数:9,代码来源:example.py

示例3: _init_kernel_manager

# 需要导入模块: from IPython.frontend.qt.kernelmanager import QtKernelManager [as 别名]
# 或者: from IPython.frontend.qt.kernelmanager.QtKernelManager import load_connection_file [as 别名]
 def _init_kernel_manager(self):
     """"""
     
     km = QtKernelManager(connection_file=self._connection_file,
                          config=self.config)
     km.load_connection_file()
     km.start_channels(hb=self._heartbeat)
     self.kernel_manager = km
     atexit.register(self.kernel_manager.cleanup_connection_file)
开发者ID:ChannelFinder,项目名称:hla,代码行数:11,代码来源:embedIPython.py

示例4: default_manager

# 需要导入模块: from IPython.frontend.qt.kernelmanager import QtKernelManager [as 别名]
# 或者: from IPython.frontend.qt.kernelmanager.QtKernelManager import load_connection_file [as 别名]
def default_manager(kernel):
    """ Return a configured QtKernelManager

    :param kernel: An IPKernelApp instance
    """
    connection_file = find_connection_file(kernel.connection_file)
    manager = QtKernelManager(connection_file=connection_file)
    manager.load_connection_file()
    manager.start_channels()
    atexit.register(manager.cleanup_connection_file)
    return manager
开发者ID:eteq,项目名称:glue,代码行数:13,代码来源:terminal.py

示例5: connect_kernel

# 需要导入模块: from IPython.frontend.qt.kernelmanager import QtKernelManager [as 别名]
# 或者: from IPython.frontend.qt.kernelmanager.QtKernelManager import load_connection_file [as 别名]
    def connect_kernel(self, connection_file, heartbeat=False):
        """
        connection_file: str - is the connection file name, for example
        'kernel-16098.json'.
        heartbeat: bool - workaround, needed for right click/save as
                          ... errors ... i don't know how to
                          fix this issue. Anyone knows? Anyway it
                          needs more testing
            example1 (standalone):

                    app = QtGui.QApplication([])
                    widget = IPythonConsoleQtWidget()
                    widget.set_default_style(colors='linux')


                    widget.connect_kernel(
                        connection_file='some connection file name')

                    app.exec_()

            example2 (IPythonLocalKernelApp):

                    app = QtGui.QApplication([])

                    kernelapp = IPythonLocalKernelApp.instance()
                    kernelapp.initialize()

                    widget = IPythonConsoleQtWidget()

                    # Green text, black background ;)
                    widget.set_default_style(colors='linux')

                    widget.connect_kernel(
                        connection_file='kernelapp.get_connection_file())

                    app.exec_()

        """
        km = QtKernelManager(
            connection_file=find_connection_file(connection_file),
            config=self.config)
        km.load_connection_file()
        km.start_channels(hb=heartbeat)
        self.kernel_manager = km
        atexit.register(self.kernel_manager.cleanup_connection_file)
开发者ID:SharpLu,项目名称:Sympathy-for-data-benchmark,代码行数:47,代码来源:console.py

示例6: get_widget

# 需要导入模块: from IPython.frontend.qt.kernelmanager import QtKernelManager [as 别名]
# 或者: from IPython.frontend.qt.kernelmanager.QtKernelManager import load_connection_file [as 别名]
        def get_widget(self, droplist_completion=True):
            if IPython.__version__ < '0.13':
                completion = droplist_completion
            else:
                completion = 'droplist' if droplist_completion else 'plain'
            widget = RichIPythonWidget(gui_completion=completion)

            cf = find_connection_file(self.kernel_app.connection_file)
            km = QtKernelManager(connection_file=cf, config=widget.config)
            km.load_connection_file()
            km.start_channels()
            widget.kernel_manager = km
            atexit.register(km.cleanup_connection_file)

            sys.stdout = self._stdout
            sys.stderr = self._stderr
            sys.displayhook = self._dishook

            return widget
开发者ID:amchagas,项目名称:spykeviewer,代码行数:21,代码来源:ipython_connection.py

示例7: new_frontend_slave

# 需要导入模块: from IPython.frontend.qt.kernelmanager import QtKernelManager [as 别名]
# 或者: from IPython.frontend.qt.kernelmanager.QtKernelManager import load_connection_file [as 别名]
 def new_frontend_slave(self, current_widget):
     """Create and return a new frontend attached to an existing kernel.
     
     Parameters
     ----------
     current_widget : IPythonWidget
         The IPythonWidget whose kernel this frontend is to share
     """
     kernel_manager = QtKernelManager(
                             connection_file=current_widget.kernel_manager.connection_file,
                             config = self.config,
     )
     kernel_manager.load_connection_file()
     kernel_manager.start_channels()
     widget = self.widget_factory(config=self.config,
                             local_kernel=False)
     widget._existing = True
     widget._may_close = False
     widget._confirm_exit = False
     widget.kernel_manager = kernel_manager
     return widget
开发者ID:stefanv,项目名称:ipython,代码行数:23,代码来源:qtconsoleapp.py

示例8: connect_kernel

# 需要导入模块: from IPython.frontend.qt.kernelmanager import QtKernelManager [as 别名]
# 或者: from IPython.frontend.qt.kernelmanager.QtKernelManager import load_connection_file [as 别名]
 def connect_kernel(self, conn, heartbeat=False):
     km = QtKernelManager(connection_file=find_connection_file(conn))
     km.load_connection_file()
     km.start_channels(hb=heartbeat)
     self.kernel_manager = km
     atexit.register(self.kernel_manager.cleanup_connection_file)
开发者ID:satishgoda,项目名称:PyInterp,代码行数:8,代码来源:QIPythonWidget.py


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