Created
April 2, 2010 15:38
-
-
Save jbalogh/353276 to your computer and use it in GitHub Desktop.
iPython macros are great for executing the same code over and over.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [6]: hist | |
1: _ip.magic("ed xx") | |
2: from addons.models import AddonRecommendation, Addon | |
3: import transformer | |
4: q = Addon.objects.all().transform(transformer.get_trans).filter(id=1865) | |
5: q.get() | |
6: _ip.magic("hist ") | |
In [7]: macro xx 2-5 | |
Macro `xx` created. To execute, type its name (without quotes). | |
Macro contents: | |
from addons.models import AddonRecommendation, Addon | |
import transformer | |
q = Addon.objects.all().transform(transformer.get_trans).filter(id=1865) | |
q.get() | |
In [8]: store xx | |
Stored 'xx' (Macro) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment