IPython notebook with Plone

IPython notebook is a browser based python shell with lots of nice features. Almost every presentation at Pycon.ie featured it in some way or other. If you’re a fan of using IPython with plone, you may find notebook interesting too.

It’s easy to get it working via buildout, just add an extra argument to the initialization:

[ipzope-notebook]
recipe = zc.recipe.egg
eggs = 
    ipython
    ${instance:eggs}
initialization =
    import sys, os
    os.environ["INSTANCE_HOME"] = "${instance:location}"
    sys.argv[1:1] = "notebook --profile zope2".split()
scripts = ipython=ipzopenb

Image

Advertisements

1 thought on “IPython notebook with Plone”

  1. Can you show your zope2 profile?
    I am using IPython wirh Plone for a while without the notebook. When I call it without the notebook option
    sys.a rgv[1:1] = “–profile zope”.split()
    I get the full sys.path with the Plone vars (app, utils etc.).
    When I call it with the notebook option
    sys.a rgv[1:1] = “notebook –ip=192.168.45.131 –profile zope”.split()
    I do not get the full sys.path but a reduced one. See below.
    Any hint?

    [”,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/setuptools-0.9.8-py2.7.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/ipython-1.2.1-py2.7.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/nose-1.3.1-py2.7.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/pyzmq-14.1.1-py2.7-linux-i686.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/Jinja2-2.7.2-py2.7.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/Pygments-1.6-py2.7.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/Sphinx-1.2.2-py2.7.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/tornado-3.2-py2.7-linux-i686.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/MarkupSafe-0.19-py2.7-linux-i686.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/docutils-0.11-py2.7.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/backports.ssl_match_hostname-3.4.0.2-py2.7.egg’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python27.zip’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/plat-linux2’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/lib-tk’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/lib-old’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/lib-dynload’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages’,
    ‘/home/Plone-4.3.2/Python-2.7/lib/python2.7/site-packages/ipython-1.2.1-py2.7.egg/IPython/extensions’]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s