[IPython-dev] Python code to Notebook?

Doug Blank doug.blank at gmail.com
Tue Feb 25 09:40:41 EST 2014


On Tue, Feb 25, 2014 at 9:30 AM, Matthias BUSSONNIER <
bussonniermatthias at gmail.com> wrote:

>
> Le 25 févr. 2014 à 14:45, Doug Blank a écrit :
>
> Is there a project that converts python code to a notebook? I have some
> simple code [1]  that just wraps the code in a cell, and signs it, but I
> could image lots of useful options: breaking up into cells (based on
> indentation), turning comment blocks into markdown sells, special
> conversion commands in comments, etc.
>
>
> https://github.com/mattpap/scala_school_notebooks/blob/master/xipynb
>

Thanks; that has a couple of interesting ideas.


>
> and you can already drop .py file on python dashboard.
>

Ah, you mean that you can drop .py into a cell? I did not know that, and is
useful! But looking for some automation.

Thanks!

-Doug


>
> --
> M
>
>
> I have a large number of example files that it would be handy to automate
> the conversion and end up with useful notebooks for further editing and
> demonstrations. This could also be handy for a generic "Save as Notebook"
> option in Python editors.
>
> It could even allow .py files (or other languages) to appear in the
> notebook file listings, and allow automatic conversion to a notebook on
> selection (at least when talking to a kernel server).
>
> Thanks for any pointers,
>
> -Doug
>
> [1] -
> https://bitbucket.org/ipre/calico/src/master/notebooks/code2notebook.py
>  _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140225/680170dd/attachment.html>


More information about the IPython-dev mailing list