Using magic commands outside of Interactive Shell in IPython

后端 未结 1 1809
礼貌的吻别
礼貌的吻别 2020-12-10 07:29

Is there a way to use \"magic commands\" from IPython from an outside file? For example if I have a file, \"rcode.py\" with the code:

%load_ext rmagic
%R a=c         


        
相关标签:
1条回答
  • 2020-12-10 08:30

    If you name your file with a .ipy extension, ipython will parse it properly. You can simply make a symlink if you want:

    $ ln -s rcode.py rcode.ipy
    $ ipython rcode.ipy
    
    0 讨论(0)
提交回复
热议问题