Skip to content

@epatters /embedded_qtconsole.py
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Embedded IPython kernel examples
from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.frontend.qt.embedded_kernelmanager import QtEmbeddedKernelManager
from IPython.frontend.qt.kernelmanager import QtKernelManager
from IPython.lib import guisupport
def main():
app = guisupport.get_app_qt4()
km = QtEmbeddedKernelManager()
#km = QtKernelManager()
km.start_kernel()
km.start_channels()
def stop():
km.shutdown_kernel()
km.stop_channels()
app.exit()
control = RichIPythonWidget()
control.exit_requested.connect(stop)
control.kernel_manager = km
control.show()
guisupport.start_event_loop_qt4(app)
if __name__ == '__main__':
main()
from IPython.embedded.blockingkernelmanager import BlockingEmbeddedKernelManager
from IPython.zmq.blockingkernelmanager import BlockingKernelManager
# Note: ZMQTerminalInteractiveShell does not actually depend on ZMQ.
from IPython.frontend.terminal.console.interactiveshell import \
ZMQTerminalInteractiveShell
def main():
km = BlockingEmbeddedKernelManager()
#km = BlockingKernelManager()
km.start_kernel()
km.start_channels()
shell = ZMQTerminalInteractiveShell(kernel_manager=km)
shell.mainloop()
if __name__ == '__main__':
main()
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.