3

bash エイリアスを IPython バージョン >= 0.11 にどのように移植しますか?

この質問は、IPython < 0.11 に対して既に回答されており、そのリンクは次のとおりです。

http://ipython.scipy.org/Wiki/tips

4

1 に答える 1

2

これが私の解決策です。改善歓迎!

あなたの ipython 設定で、次の行を追加します: (私のものはここにあります: ~/.config/ipython/profile_default/ipython_config.py)

c = get_config()

## Port bash aliases to ipython
import os, string
a = os.popen("bash -l -c 'alias'").read()
a = a.translate(string.maketrans("=", ' '), '\'"').split('alias ')
a = [tuple(x.strip().split(' ', 1)) for x in a]
c.AliasManager.user_aliases = [x for x in a if len(x) == 2]
于 2011-10-06T23:40:03.183 に答える