There's no reason to do it this way in code, but I sometimes find it useful in the interactive interpreter.
0
votes
Yes, modules can be imported under an alias name.
using as keyword.
See
import math as ilovemaths # here math module is imported under an alias name
print(ilovemaths.sqrt(4)) # Using the sqrt() function
-1
votes
from MODULE import TAGNAME as ALIAS
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more