三种:import 模块名[as 别名]
①import math //导入标准库math
math.sin(3.4)
import math as mt
mt.sin(3.4)
②from 模块 import 对象
from math import sin //只导入指定对象
sin(3)
③from 模块名 import *
from math import * #导入标准库math所有对象
三种:import 模块名[as 别名]
①import math //导入标准库math
math.sin(3.4)
import math as mt
mt.sin(3.4)
②from 模块 import 对象
from math import sin //只导入指定对象
sin(3)
③from 模块名 import *
from math import * #导入标准库math所有对象