How to let Pool.map take a lambda function

前端 未结 4 1574
甜味超标
甜味超标 2020-12-01 07:27

I have the following function:

def copy_file(source_file, target_dir):
    pass

Now I would like to use multiprocessing to exe

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 08:00

    From this answer, pathos let's you run your lambda p.map(lambda x: copy_file(x,target_dir), file_list) directly, saving all the workarounds / hacks

提交回复
热议问题