Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a "python2" alias or rename the "python"cell magic. #5442

Closed
Ismael-VC opened this issue Mar 27, 2014 · 2 comments · Fixed by #5447
Closed

Make a "python2" alias or rename the "python"cell magic. #5442

Ismael-VC opened this issue Mar 27, 2014 · 2 comments · Fixed by #5447
Milestone

Comments

@Ismael-VC
Copy link
Contributor

Running under Arch Linux where currently ipython uses python 3.3.5 instead of python 2.x, which in order to be used has to be called as ipython2 (for python 2.7.6):

ismaelvc@toybox ~ % ipython
Python 3.3.5 (default, Mar 10 2014, 04:22:19)
Type "copyright", "credits" or "license" for more information.

IPython 1.2.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]:

When using the notebook, I wanted to use some python2 code, but there are only %%python and %%python3 cell magics, which in my case are the same, currently I had to paste the code in a markdown cell (to have syntax highlighting) if I want to show it along with the python3 examples, and then use the %%bash magic in another code cell to call the python2 script, example:

python2_magic

@Ismael-VC Ismael-VC changed the title Make a "python2" alias for the "python" magic. Make a "python2" alias or rename the "python" magic. Mar 27, 2014
@Ismael-VC Ismael-VC changed the title Make a "python2" alias or rename the "python" magic. Make a "python2" alias or rename the "python"cell magic. Mar 27, 2014
takluyver added a commit to takluyver/ipython that referenced this issue Mar 27, 2014
@takluyver
Copy link
Member

That seems reasonable - see PR #5447.

@minrk minrk added this to the 2.0 milestone Mar 27, 2014
@Ismael-VC
Copy link
Contributor Author

@takluyver and @minrk thank you! 😄

Zaharid pushed a commit to Zaharid/ipython that referenced this issue Apr 22, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants