1. 程式人生 > 實用技巧 >2. import 與 from...import 匯入模組

2. import 與 from...import 匯入模組

1. 匯入整個模組
  格式: import somemodule

2. 從某個模組中匯入某個函式
  格式: from somemodule import somefunction

3. 從某個模組中匯入多個函式
  格式: from somemodule import firstfunc, secondfunc, thirdfunc

4. 將某個模組中的全部函式匯入
  格式: from somemodule import *