Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

doc issue: notebooks that ship with Ipython .13 are written for python 2.x #2622

Closed
pleabargain opened this Issue Nov 26, 2012 · 5 comments

Comments

Projects
None yet
5 participants

Maybe a comment somewhere in the notebooks themselves that they are written for python 2.x would be appropriate?

confirmed ipynbs for P 2.x:
00
01
and
Animations

Contributor

bfroehle commented Nov 26, 2012

Would it be feasible to write the demo notebooks in such a way that they would work in Python 2 and Python 3?

Owner

Carreau commented Nov 26, 2012

We could write a custom 2to3 fixer for ipynb.

Python version could be added in nb metadata.
Le 26 nov. 2012 22:37, "Bradley M. Froehle" notifications@github.com a
écrit :

Would it be feasible to write the demo notebooks in such a way that they
would work in Python 2 and Python 3?


Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/issues/2622#issuecomment-10735019.

Owner

takluyver commented Nov 27, 2012

I'd rather not use 2to3 for the examples. I've had a quick look at those notebooks, and I think the only problem is print, which is easy to solve. For a single argument, print(foo) already works in Python 2, and where there are multiple arguments, we can use from __future__ import print_function.

Contributor

bfroehle commented Nov 27, 2012

Given how the notebooks are installed in system packages (i.e., /usr/share/doc/ipython/examples/notebooks/Script Magics.ipynb) is Python version agnostic, I'd rather not require 2to3 to do any mangling. (Although it is a reasonable and interesting idea, perhaps could be in nbconvert?)

Like @takluyver, I suspect that most issues are related to print and those are easily worked around.

Owner

takluyver commented Nov 28, 2012

See PR #2627

@minrk minrk closed this in 040d847 Jan 20, 2013

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

Merge pull request #2537 from ellisonbg/examples
Organize example notebooks

- Some refactor and reorganization of notebooks
- examples moved to top-level examples dir, out of docs
- py3compat along the way

closes #2622
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment