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 magic alias #221

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

added examples and reported a bug...

Wrote examples for %alias.
Work done as a team by:
- Archana chinna
- Navya chodisetti
- Sridhar
- Nagaraju

nice work navvya:from Nag and thanks u

@takluyver takluyver commented on the diff Feb 15, 2011

IPython/core/magic.py
@@ -2456,19 +2456,15 @@ Defaulting color scheme to 'NoColor'"""
alias can not be executed until 'del foo' removes the Python variable.
You can use the %l specifier in an alias definition to represent the
- whole line when the alias is called. For example:
-
@takluyver

takluyver Feb 15, 2011

Owner

Why has this example been removed? It's a helpful addition to the bit above it.

@takluyver takluyver commented on the diff Feb 15, 2011

IPython/core/magic.py
@@ -2488,6 +2484,44 @@ Defaulting color scheme to 'NoColor'"""
A Python string
In [9]: show $$PATH
/usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
+ example:
+ -------
+ explanation::
+
+ here in this example we are aliasing the command ls with lst
+ so that if we want to list the directories we can use the command lst.
+
+
+ In [1]: alias lst ls
+ In [2]: lst
@takluyver

takluyver Feb 15, 2011

Owner

This isn't the best example - you can already use ls directly in IPython.

@takluyver takluyver commented on the diff Feb 15, 2011

IPython/core/magic.py
+ example:
+ -------
+ explanation::
+
+ here in this example we are aliasing the command ls with lst
+ so that if we want to list the directories we can use the command lst.
+
+
+ In [1]: alias lst ls
+ In [2]: lst
+ COPYING.txt ipython.egg-info/ README.txt setupbase.pyc setup.py*
+ docs/ ipython.py* scripts/ setupegg.py* tools/
+ IPython/ MANIFEST.in setupbase.py setupext/
+
+ In [1]: alias manual mkdir
+ In [2]: manual
@takluyver

takluyver Feb 15, 2011

Owner

If you try running this, it doesn't actually do this.

Owner

takluyver commented Feb 15, 2011

We agreed on the mailing list that the existing examples are enough. Thanks, archana.

This issue was closed.

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