三種:import 模塊名[as 別名]
①import math? //導(dǎo)入標(biāo)準(zhǔn)庫math
math.sin(3.4)
import math as mt
mt.sin(3.4)
②from 模塊 import 對象
from math import sin? //只導(dǎo)入指定對象
sin(3)
③from 模塊名 import *
from math import *? ? ? #導(dǎo)入標(biāo)準(zhǔn)庫math所有對象
三種:import 模塊名[as 別名]
①import math? //導(dǎo)入標(biāo)準(zhǔn)庫math
math.sin(3.4)
import math as mt
mt.sin(3.4)
②from 模塊 import 對象
from math import sin? //只導(dǎo)入指定對象
sin(3)
③from 模塊名 import *
from math import *? ? ? #導(dǎo)入標(biāo)準(zhǔn)庫math所有對象