I have two python files, one is calling (importing) the other. But when I make a change in the module which is called, change is not applied unless I quit from Python and re-open it. Then I can see that changes are working. Here is a short example:
mainfile.py:
from otherfile import myfunc
a=5
myfunc(a)
otherfile.py:
def myfunc (x):
print(x+3)
when I run mainfile.py, it prints 8 as expected. But when I change the last line in otherfile.py to print(x+4), and save it, running mainfile.py still prints 8! After quitting from Python and re-enter it, now it prints 9.
I googled this issue but couldn't find anything. Some people talks about "init", I have no idea what it is. I am very new to Python, so I appreciate if you explain this in a very basic way.
Thanks!
Note: I am using Python 3.6.1 on Anaconda 4.4.0 with Spyder 3.1.4