<div dir="ltr">Hi Thomas,<div><br></div><div>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.</div><div>
<br></div><div>Cheers,</div><div>Aron</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Nov 3, 2013 at 12:14 PM, Thomas Kluyver <span dir="ltr"><<a href="mailto:takowl@gmail.com" target="_blank">takowl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im"><div class="gmail_extra"><br><div class="gmail_quote">On 3 November 2013 01:17, Raniere Silva <span dir="ltr"><<a href="mailto:ra092767@ime.unicamp.br" target="_blank">ra092767@ime.unicamp.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow:hidden">I need to convert some Python2 `print` statements to Python3 `print` function<br>
in .ipynb files. `2to3` didn't work. What tool I can use?</div></blockquote></div><br><br></div></div><div class="gmail_extra">Copying my comment from the Software Carpentry Github thread here: <a href="https://github.com/swcarpentry/bc/issues/107" target="_blank">https://github.com/swcarpentry/bc/issues/107</a><br>
<br>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:
<ul><li>Some changes should only be done once per notebook, e.g. adding <code>from __future__</code> imports.</li><li>IPython special syntax, e.g. <code>%magics</code> might break the parser 2to3 is using.</li></ul><p>Thanks,</p>
<p>Thomas<br></p><br></div></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>