So, recently, I've been experimenting with the multiprocessing module. I wrote this script to test it:
from multiprocessing import Process
from time import sleep
def a(x):
sleep(x)
print ("goo")
a = Process(target=a(3))
b = Process(target=a(5))
c = Process(target=a(8))
d = Process(target=a(10))
if __name__ == "__main__":
a.start()
b.start()
c.start()
d.start()
However, when I try to run it, it throws this error:
goo
Traceback (most recent call last):
File "C:\Users\Andrew Wong\Desktop\Python\test.py", line 9, in <module>
b = Process(target=a(5))
TypeError: 'Process' object is not callable
...And I can't tell what's going on. Does anyone know what happened, and how I can fix it?