[IPython-dev] 2to3 for IPython Notebook
aron at ahmadia.net
Sun Nov 3 13:37:51 EST 2013
Thanks for this. Just to avoid confusion, let's keep the discussion in one
place, I propose the issue you linked, since I suspect Greg Wilson will
want to way in.
On Sun, Nov 3, 2013 at 12:14 PM, Thomas Kluyver <takowl at gmail.com> wrote:
> On 3 November 2013 01:17, Raniere Silva <ra092767 at ime.unicamp.br> wrote:
>> I need to convert some Python2 `print` statements to Python3 `print`
>> in .ipynb files. `2to3` didn't work. What tool I can use?
> Copying my comment from the Software Carpentry Github thread here:
> We don't have an automated conversion tool for notebooks ourselves - we
> don't curate enough notebooks ourselves to really need one. However, it
> should be feasible to write something that loads a notebook, runs 2to3 on
> each of the code cells, and saves it again. I'm happy to help build that.
> It's not entirely trivial, though:
> - Some changes should only be done once per notebook, e.g. adding from
> __future__ imports.
> - IPython special syntax, e.g. %magics might break the parser 2to3 is
> IPython-dev mailing list
> IPython-dev at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev