『Python』多进程

https://docs.python.org/3/library/multiprocessing.html?highlight=imap_unordered#multiprocessing.pool.Pool.imap_unordered

注意,worker函数不能写在其他函数内部:

def fun1():

    def worker():

        pass

多个参数时直接用[(),()]传实际会将()传给worker的首个参数,所以worker接收argv,在worker内用0~n去索引()的元素就行了

posted @ 2021-06-04 17:17  叠加态的猫  阅读(76)  评论(0编辑  收藏  举报