I have a problem with the code below, and with any code that uses the print
function in the child processes. I can\'t see any printed statements, even if I use
Try this:
from multiprocessing import Process
import sys
def f(name):
print 'hello', name
sys.stdout.flush()
...
AFAIK the standard output of processed spawned by the multiprocessing
module is buffered, hence you will see the output only if the buffer becomes full or you explicitly flush sys.stdout
.