multiprocessing.pool.map and function with two arguments

后端 未结 5 1814
臣服心动
臣服心动 2020-12-15 10:54

I am using multiprocessing.Pool()

here is what i want to Pool:

def insert_and_process(file_to_process,db):
    db = DAL(\"path_to_mysql\         


        
5条回答
  •  清歌不尽
    2020-12-15 11:16

    You can use

    from functools import partial 
    

    library for this purpose

    like

    func = partial(rdc, lat, lng)
    r = pool.map(func, range(8))
    

    and

    def rdc(lat,lng,x):
        pass 
    

提交回复
热议问题