如果python中導入線程池的模塊:from concurrent.futures import ThreadPoolExecutor,編譯器會報提示說找不到模塊。
其實python3標準庫裏包含concurrent模塊,ThreadPoolExecutor在Thread.py中。
所以導入模塊的方式爲: from concurrent.futures.Thread import ThreadPoolExecutor
查看python標準庫裏的模塊一種方式:
1、找到python的安裝目錄
2、打開Lib文件夾
3、右上角輸入要查找的模塊,會顯示搜索結果。