我试图让我的 ipython 别名持久化,并且根据文档,%store 魔术函数提供了此功能。但这对我不起作用。
wim@SDFA100461C:/tmp$ echo 'print("hello world!")' > test.py
wim@SDFA100461C:/tmp$ ipython
In [1]: alias potato python /tmp/test.py
In [2]: potato
hello world!
In [3]: %store potato
Alias stored: potato (python /tmp/test.py)
In [4]:
Do you really want to exit ([y]/n)?
wim@SDFA100461C:/tmp$ ipython
In [1]: potato
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-e561f9248d75> in <module>()
----> 1 potato
NameError: name 'potato' is not defined
我在 IPython 1.1.0 / Python 2.7.5+