execute Bash command from IPython

前端 未结 2 1480
悲&欢浪女
悲&欢浪女 2021-02-01 06:05

I want to source my bash environment when executing a bash command from IPython using the ! operator, thus allowing me access to my defined bash functions:

2条回答
  •  独厮守ぢ
    2021-02-01 06:45

    Fernando Perez, creator of IPython, suggests this:

    In [1]: %%bash
    . ~/.bashrc
     
    

    This works on the current stable version (0.13.2). He admits that's a bit clunky, and welcomes pull requests. . .

提交回复
热议问题