Python从模块导入函数
第一种
>>> import math
>>> math.sqrt(4)
2.0
>>> import math as mymath
>>> mymath.sqrt(4)
2.0
第二种
>>> from math import sqrt
>>> sqrt(4)
2.0
>>> from math import sqrt as mysqrt
>>> mysqrt(4)
2.0
>>> from math import sqrt,sin,tan
>>> from math import *
第三种
>>> mymath= __import__('math')
>>> mymath.sqrt(4)
2.0