[IPython-dev] SWC using IPython Notebook

MinRK benjaminrk at gmail.com
Fri Oct 5 15:38:58 EDT 2012


On Fri, Oct 5, 2012 at 11:38 AM, Erik Bray <erik.m.bray at gmail.com> wrote:

> On Thu, Oct 4, 2012 at 5:41 PM, Brian Granger <ellisonbg at gmail.com> wrote:
> > - A way for an instructor to make a notebook then strip out code for
> > distribution to students (so they can see our annotations but have to
> type
> > their own code).
> >
> >
> > So basically just remove all code cells, right?  That won't be too
> > difficult.
>
> Maybe.  More useful, for me anyways, would be to leave the code cells
> in but strip everything out of them except for comments.  I've been
> thinking of writing a little script to do this, because I have a
> couple notebooks I would like to do that to for the purposes of
> teaching.  For simplicity's sake it would only work on code cells that
> actually contain Python code :)
>

The script I linked above is close: https://gist.github.com/3836889

It empties out code cells that start with a particular comment.
It should be straightforward to modify it to perform any transformation you
want.

-MinRK


>
> Erik
> _______________________________________________
> 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/20121005/d23ea889/attachment.html>


More information about the IPython-dev mailing list