%storemagic
stores variables and macros on IPython's database.
To automatically restore stored variables at startup add this to ipython_config.py
:
c.StoreMagic.autorestore = True
Example:
In [1]: l = ['hello',10,'world']
In [2]: %store l
In [3]: exit
(IPython session is closed and started again...)
ville@badger:~$ ipython
In [1]: l
Out[1]: ['hello', 10, 'world']
Note:
It should be noted that if you change the value of a variable, you need to %store it again if you want to persist the new value.
Note also that the variables will need to be pickleable; most basic python types can be safely %storeād.