[IPython-user] Nifty %store...

Fernando Perez Fernando.Perez at colorado.edu
Thu Dec 29 23:31:53 CST 2005


Ville Vainio wrote:
> On 12/29/05, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
> 
> 
>>My macro is nicely sitting there, and it's just as if I'd retyped those three
>>lines myself.  Very, very handy.
> 
> 
> Good point about the macros - I never used them because they disappear
> after ipython shutdown. I did think that %store could unleash a bunch
> of useful working patterns combined with other ipython features, but
> it's still nice to see I can start using macros for some serious &
> tedious routine where writing a script feels too heavyweight.

Yup, I really like them.  Note that I also changed whos a little, to be more 
informative.  So now, upon startup, I get:

abdul[~]> ip --nobanner

In [1]: whos
Variable   Type                   Data/Info
-------------------------------------------
db         IPython.macro.Macro    import 
descriptors\nreloa<...>criptors.watched()\nm.x\n
mm         IPython.macro.Macro    for i in range(5):\n    i\n    \n\n34\n


db and mm are two macros I've got saved from debugging earlier today. 
Combined with %save and the ability to enter long, multi-line input with blank 
lines either directly or from copy/paste (this didn't use to work), I think 
ipython can be a useful little tool :)

Thanks again for your contributions: you've made a real difference in some of 
these really useful areas.

Cheers,

f




More information about the IPython-user mailing list