Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Embedded Ipython Qt attempt.
import sys
sys.path.insert(0, "../../ipython")
from IPython.embedded.ipkernel import EmbeddedKernel
from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.frontend.qt.embedded_kernelmanager import QtEmbeddedKernelManager
from IPython.lib import guisupport
from PyQt4.QtGui import QFrame,QHBoxLayout
from PyQt4.QtGui import QApplication
class IpythonEmbeddedWidget(QFrame):
def __init__(self):
QFrame.__init__(self)
self._layout = QHBoxLayout()
self._kernel = EmbeddedKernel()
self._kernel_manager = QtEmbeddedKernelManager(kernel = self._kernel)
self._kernel_manager.start_channels()
self._kernel.frontends.append(self._kernel_manager)
self._shell_widget = RichIPythonWidget()
app = guisupport.get_app_qt4()
self._shell_widget.exit_requested.connect(app.quit)
self._shell_widget._kernel_manager = self._kernel_manager
self._layout.addWidget(self._shell_widget)
self.setLayout(self._layout)
app = QApplication(sys.argv)
iew = IpythonEmbeddedWidget()
iew.show()
app.exec_()
sys.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.