I'm trying to use multiprocessing with multiple args to print dummy values, but this doesn't seems to work. I get error
"f() missing 2 required positional arguments:..."
for the following code:
from multiprocessing import Pool
class tryProcessing:
def f(self, arr, arg1, arg2):
print(arr + " " + arg1 + " " + arg2)
def func(self, arr, arg1, arg2):
arg1 = "hi"
arg2 = "hello"
arr_a = ['1','2']
arr_b = ['3','4','5']
p = Pool(Processes=2)
p.map(self.f, [[a, arg1, arg2], [b, arg1, arg2]])
p.close
What am I doing wrong?
P.s. in this answer, he did something similar, I don't understand why his works, and mine doesn't.