[Tutor] Importing functions in IPython

Jaidev Deshpande deshpande.jaidev at gmail.com
Sun Jan 22 23:10:26 CET 2012


Dear List,

Suppose I have a function myfunc() in a module called mymodule.py

As usual, I import this function in IPython with

In[1]: from mymodule import myfunc

Now if I find that there is something wrong with myfunc, I can open
mymodule.py with a suitable editor and make the required changes.

Now when I delete the original function and import the changed one,

In[2]: del myfunc

In[3]: from mymodule import myfunc

it doesn't work as per the new changes. I have to close IPython and
start all over again.

Is there a less cumbersome way to do this, preferably without closing IPython?

Thanks


More information about the Tutor mailing list