I imported a module as below:
filename = \"email\"
mymodule = __import__(\'actions.\'+filename)
the problem I have with this is, that the file
The problem is, that you get the actions
module returned. Try this:
mymodule = __import__('actions.'+filename)
for submodule in filename.split('.'):
mymodule = getattr(mymodule, submodule)
This happens when you try importing a submodule, i.e. module.something.somethingelse
, you get module
returned.
The functions don't exist unless the module executes. You can't have it both ways. Perhaps you need to add a main stanza to the module.