标签:tor executor mit 线程 pool range current format def
from concurrent.futures import ThreadPoolExecutor
import time
def task(a1,a2):
time.sleep(1)
print("{},{}".format(a1, a2,))
if __name__ == '__main__':
# 定义线程池
pool = ThreadPoolExecutor(10)
for i in range(100):
# 申请线程池中的线程
pool.submit(task, i, 8)
标签:tor executor mit 线程 pool range current format def
原文地址:https://www.cnblogs.com/pythonPath/p/12459702.html