How can I make this import:
from module import *
with imp module?
Disclaimer:
- I need use
impmodule because I need make several statements and I want to do it dynamicly - I need use
*because I need that in the file I made the import, the variables and methods defined inmodulebe available directly, i meanwithout module.methodormodule.variable. And I want import all variables and methods in the module because I don’t know what methods or variables can be in the module in the future
Here!
I am kind of making things up there a little bit with trying to find an
__all__symbol first and then, if that files, doing adir()and grabbing symbols that look non-private — you would have to look at the implementation ofimport *to know if that resembles Python’s actual logic closely enough for your purposes.