I am trying to learn how Python reloads modules, but have hit a roadblock. Let's say I have:
dir1\file1.py
:
from dir2.file2 import ClassOne
myObject = ClassOne()
dir1\dir2\file2.py
:
class ClassOne():
def reload_module():
reload(file2)
The reload call fails to find module "file2".
My question is, how do I do this properly, without having to keep everything in one file?
A related question: When the reload does work, will myObject use the new code?
thank you