利用线程池启动线程 submit与map启动线程 利用两种方式分别启动线程,同时利用with上下文管理来对线程池进行控制 from concurrent.futures import ThreadPoolExecutor as tpe from concurrent.futures import ProcessPoolExecutor as ppe from time import ctime, sleep from random import randint def foo(x, name):…