In Python, is it possible to define an alias for an imported module?
For instance:
import a_ridiculously_long_module_name
...so that is has an alias of 'short_name'.
In Python, is it possible to define an alias for an imported module?
For instance:
import a_ridiculously_long_module_name
...so that is has an alias of 'short_name'.
also works for
If you've done:
you can also give it an alias by:
There's no reason to do it this way in code, but I sometimes find it useful in the interactive interpreter.
Check here
or
Yes, modules can be imported under an alias name. using as keyword. See