I am trying to import a module with the __import__ because I want to
dynamically call a method from multiple modules this is the original import
code:
from Art.Scripts import MyScript as myScript
myScript.Run()
What I would like to do is something like this:
module = __import__ ('Art/Scripts/%s' % Module)
getattr(module, 'Run')
How can I achieve this, when it's saying *Import by filename is not
supported. #*
Thanks guys!
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/e8be73c8-5cb9-48ce-bb6e-d83e2e92fc44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.