0

I doubt if my fun() function is getting called through process() or not. Bcoz sometimes I am getting output with error. Plz help

import json import jsonpath import datetime from multiprocessing import process def fun(l,m): somecode p1= process(target=fun(0,1000)) p1.start() Output: 1) somecode p1= process(target=fun(0,1000)) TypeError: 'module' object is not callable. 2) p1= process(target=fun(0,1000)) TypeError: 'module' object is not callable

19th Mar 2020, 6:50 AM
kishore sai anil
4 Antworten
0
Hi Mirielle👽 Thanks for your support. That error is fixed but i am seeing other error and multiprocessing seems to be not working. Because I am getting output only after execution of each iteration. Not parallely. and sometimes my program is getting paused with the error as mentioned below the code. Can you please help. Below is the code.
19th Mar 2020, 3:25 PM
kishore sai anil
0
import json import jsonpath import datetime from multiprocessing import process def fun(l,m): somecode p2= multiprocessing.Process(target=fun(1000,2000)) p2.start() p3= multiprocessing.Process(target=fun(2000,3000)) p3.start() p4= multiprocessing.Process(target=fun(3000,4000)) p4.start() p5= multiprocessing.Process(target=fun(4000,5000)) p5.start() p6= multiprocessing.Process(target=fun(5000,6000)) p6.start() p7= multiprocessing.Process(target=fun(6000,7000)) p7.start() p8= multiprocessing.Process(target=fun(7000,8000)) p8.start() p9= multiprocessing.Process(target=fun(8000,9000)) p9.start() p10= multiprocessing.Process(target=fun(9000,9999)) p10.start()
19th Mar 2020, 3:31 PM
kishore sai anil
0
Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\kishore.karlapudi\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\spawn.py", line 105, in spawn_main exitcode = _main(fd) File "C:\Users\kishore.karlapudi\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\spawn.py", line 114, in _main prepare(preparation_data) File "C:\Users\kishore.karlapudi\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\spawn.py", line 225, in prepare _fixup_main_from_path(data['init_main_from_path']) File "C:\Users\kishore.karlapudi\AppData\Local\Programs\Python\Python37-32\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path run_name="__mp_main__") File "C:\Users\kishore.karlapudi\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "C:\Users\kishore.karlapudi\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 96, in _run_modu
19th Mar 2020, 3:52 PM
kishore sai anil