2
I have the following code
__import__('some_module')
And I wanted to know if it was possible to do something like this:
__import__('some_module') as some_name
2
I have the following code
__import__('some_module')
And I wanted to know if it was possible to do something like this:
__import__('some_module') as some_name
3
As you have in question is not, but you can assign the return of __import__
to a var, ex:
mod_alias = __import__('string')
The equivalent of:
import string as mod_alias
In this case mod_alias
is your alias.
Browser other questions tagged python
You are not signed in. Login or sign up in order to post.