1
I wrote a module called mymodule.py
who has the function
def funcion(x):
return x
So I imported this function into a code like
from mymodule import function
and worked normally.
Then I wanted to change the function to
def function(x):
return 2*x
but the code continues to work as in the previous version of function
, with return x
. How do I reimport the object function
without having to restart the kernel? Do you know of any function similar to the importlib.reload()
for objects in Python 3?
What would be "restarting the kernel" in this context? You need to change the application with it running?
– Woss
Anderrson, I use the Jupyter Notebook. In it, for me to reimport some module I need to restart the kernel, so I want to do this reimport without needing to restart it, with it running.
– Victor H. De Oliveira Côrtes