Python Console with Python 3.4.2
I defined a function in a module which runs correctly in Python Console in PyCharm Community Edition 4.5.4:
ReloadTest.py:
Get it to work!
Instead of from Module import function
, I should import the whole module import Module
, then call the function by Module.function()
. This is because
from ReloadTest import reloadtest
and
importlib.reload(ReloadTest)
can't go together.
>>> import ReloadTest
>>> ReloadTest.reloadtest(1)
Version A: 1
After making changes:
>>> importlib.reload(ReloadTest)
>>> ReloadTest.reloadtest(2)
Version B: 2