如果python中导入线程池的模块:from concurrent.futures import ThreadPoolExecutor,编译器会报提示说找不到模块。
其实python3标准库里包含concurrent模块,ThreadPoolExecutor在Thread.py中。
所以导入模块的方式为: from concurrent.futures.Thread import ThreadPoolExecutor
查看python标准库里的模块一种方式:
1、找到python的安装目录
2、打开Lib文件夹
3、右上角输入要查找的模块,会显示搜索结果。