How to re-import a function from a module?

Kurda Yon kurdayon at yahoo.com
Wed Nov 5 20:36:07 EST 2008


Hi,

I have the following small problem. I run Python interactively. In the
beginning of the run I import many functions from many modules. Than I
execute some commands and notice that one of the imported functions
contains a mistake. I open another terminal in which I open the file
with the problematic function and correct the function. However, the
Python does not see my changes. It still uses the old version of the
function. In principle I could close the Python session and reopen it
again and import all functions agane. But it does not seem to be a
convenient solution. Is there a way to force Python to re-import the
function, i.e. to force it to use the new version of the function?

Thank you in advance.



More information about the Python-list mailing list