ThreadPoolExecutor .submit传参
时间: 2023-10-17 21:25:07 浏览: 96
ThreadPoolExecutor.submit()方法可以传递多个参数。其中一个常见的方法是使用lambda表达式来传递多个参数。例如,在引用中的代码示例中,通过使用lambda表达式将参数args传递给submit()方法来调用doFileParse()函数。在这个例子中,args是一个包含多个参数的列表,然后使用*args语法将列表中的参数解包并传递给doFileParse()函数。这样就实现了在ThreadPoolExecutor.submit()方法中传递多个参数的目的。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [python线程池 ThreadPoolExecutor 使用详解](https://blog.csdn.net/xiaoyu_wu/article/details/102820384)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [python线程池ThreadPoolExecutor,传单个参数和多个参数](https://blog.csdn.net/weixin_45393723/article/details/122666456)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文