I have structure:
modules
__init__.py
version_1.py
version_2.py
settings.py
my_script.py
__init__.py
In file version_1 and version_2 I have two versions the same function:
def ext_function(*args, **kwargs):
# something
I want to define in file settings.py what version have been loaded:
EXT_MODULE = 'modules.version_1'
and execute function in my_script like this:
settings.EXT_MODULE.ext_function(args)
How to do it? EXT_MODULE is a string so I can not execute function like this.