I have three files: module_one.py
module_two.py
module_three.py
which each has a class for itself in it:
# module_one.py
from module_two import ModuleTwo
from module_three import ModuleThree
class ModuleOne:
...
# module_two.py
from module_one import ModuleOne
from module_three import ModuleThree
class ModuleTwo:
...
# module_three.py
from module_one import ModuleOne
from module_two import ModuleTwo
class ModuleThree:
...
I have a file main.py
which looks like this:
# main.py
from module_one import ModuleOne
from module_two import ModuleTwo
from module_three import ModuleThree
... # and uses them
Which is the entry point of the application and uses those module classes.
In each of those module files (module_*.py
) as you see I have to import other modules to use them. Isn't there any better way to manage this? can I write a statement in main.py
and after that those module files that get loaded in the memory can see each other and call on themselves without having to import each other in their own files first?