Created
September 21, 2014 08:23
-
-
Save gentoo90/660984417be4db0f913e to your computer and use it in GitHub Desktop.
embed ipython kernel and automatically open console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -* | |
""" | |
Embed IPython kernel and automatically open console | |
connected to it. | |
""" | |
import os | |
from zmq.eventloop.ioloop import IOLoop | |
import IPython | |
def ip_cb(): | |
app = IPython.config.Application.instance() | |
os.system('mate-terminal -e "ipython console --existing %s"' % app.connection_file) | |
loop = IOLoop.instance() | |
loop.add_callback(ip_cb) | |
IPython.embed_kernel() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment