0

I have written a function that has 3 parameters as shown in the code. I want to run the function 7 times with different parameter values.

def abc(Link,rangeTo,filename):
    do_something

multiprocessing.process(target=abc('www.google.com',7265,'abc.csv')).start()
multiprocessing.process(target=abc('www.google2.com',765,'abc1.csv')).start()
multiprocessing.process(target=abc('www.google3.com',726,'abc2.csv')).start()

when I execute the above code it does not start 3 calls at the same time. It works like completing the 1st call then 2nd and so on. But I want it should start the all calls at the same time.

aaossa
  • 3,763
  • 2
  • 21
  • 34
  • 1
    `multiprocessing.process(target=abc('www.google.com',7265,'abc.csv')).start()` means "call `abc('www.google.com',7265,'abc.csv')` **now**, and use **the result** for `target` when calling `multiprocessing.process`". – Karl Knechtel Mar 06 '22 at 00:08
  • you have to use `target` without `(...)` and use `args` for arguments - like `process(target=abc, args=('www.google.com',7265,'abc.csv'))` and `process` will run it later using `()` like `target(*args)` – furas Mar 06 '22 at 03:55

0 Answers0