How to pass a variable to magic ´run´ function in IPython

前端 未结 4 1492
-上瘾入骨i
-上瘾入骨i 2020-12-02 11:45

I want to do something like the following:

In[1]: name = \'long_name_to_type_every_now_and_then.py\'

In[2]: %run name

but this actually tr

4条回答
  •  误落风尘
    2020-12-02 12:26

    In case there might be space in argument, e.g. filename, it is better to use this:

    %run "$filename"
    

提交回复
热议问题