[IPython-user] Feature suggestion: %remember

Ville Vainio vivainio at gmail.com
Thu Dec 8 04:33:18 CST 2005

Here's an idea that is rather easy to implement: a new magic called
%remember. It would store the name & value of the specified variable
to the same persistent_data structure as bookmarks, and all the values
in that structure would be loaded to the appropriate variables at
session startup.


> a= "hello"; b=34
> %remember a b
> Exit

(new session)

> print a,b
hello 34

A real life use:

> releasedir = "c:/plat/blah/foo/bar/long/path/name/cant/retype"
> %remember releasedir

(subsequent sessions)

> cp tarball.tar.gz $releasedir

You can see the uses: variables could be easily be used to hold
worthwhile data, and even used as a persistent "scratchpad" of a sort.
Think about

> MyDiary += "Dear diary, today sucked as well"
> %remember MyDiary

Sky is the limit! :-)

Ville Vainio    http://tinyurl.com/2prnb

More information about the IPython-user mailing list