[Tutor] Importing functions in IPython

Alan Gauld alan.gauld at btinternet.com
Sun Jan 22 23:43:29 CET 2012


On 22/01/12 22:10, Jaidev Deshpande wrote:

> In[1]: from mymodule import 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.

You can use reload() to reload the entire module, but I confess I don't 
know how to reload a function using import like that... reload doesn't 
seem to have any option for that

I'll watch this space to see if anyone else knows how.
Meantime you can try just using

import mymodule
mymodule.myfunc()

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list