IPython.display in standalone application

I have been prototyping some functionality in Jupyter notebook, using IPython.display for GUI frontend. Now I would like to move out of Jupyter to standalone application. I currently use only one ipython cell and everything runs from there using ipywidgets. I could just take the python code and port it to a differend GUI toolkit, but I find ipywidgets simple to use and sufficient in functionality. I just no longer like all the steps needed to run the code (anaconda installation, packages, jupyter notebook launch, opening ipython notebook, running cell with the code). I don’t mind to keep the Web browser dependency (run it in browser), I would just like to move out of Jupyter environment into own python environment with this project.

Is there a way to use IPython.display module outside of Jupyter notebook, in normal python executable? Or how would I go about making it possible?


You should be able to do this, but an IPython kernel still needs to be instantiated to create all of the objects needed. IPython.embed_kernel() is one function that launches a kernel in the calling context. After that, IPython.display will work. There should probably be easier ways to launch a kernel embedded in an application that doesn’t block.

Thanks, I will try it and post results.

Well, that’s not it. It would be too complicate to reach my goal directly with IPython api. I however found project Jupyter Dashboards (https://github.com/jupyter/dashboards) and Jupyter Dashboards server (https://github.com/jupyter-attic/dashboards_server). Dashboards server project is suspended and I was unable to properly start it (couldn’t set kernel gateway url, should be fixable in code). I’ll stick with the jupyter dashboards plugin for now and see how it goes. Maybe I’ll check out some alternatives to the dashboards server or try to fix it a bit.

You might want to check out Panel. It’s a pretty slick looking dashboarding to that’s part of the pyviz ecosystem. It has a widget system that is based on ipywidgets I believe but the whole thing is designed to make it easy to go from Jupyter prototype to standalone webapp pretty easily.


1 Like