I am trying to use multiprocessing in python 2.7.7. I tried to implement this example:
import multiprocessing
def worker():
"""worker function"""
print 'Worker'
return
if __name__ == '__main__':
jobs = []
for i in range(5):
p = multiprocessing.Process(target=worker)
jobs.append(p)
p.start()
This code is from https://pymotw.com/2/multiprocessing/basics.html.
My problem is, that I can't see any output of the worker process. What is the problem here?
EDIT: My operating system is Windows 7 64bit.
EDIT: It is working, if I call the python-script from the windows command line (with python script.py
). Previous I started the script from IDLE (Run Module (F5)
) and this was not working.