Message145913
print function unable while multiprocessing.Process is being run
Not sure if this really is a bug, but the multiprocessing.Process (or Pool) does not allow to print during multiprocessing tasks.
I've copied the example from The Python V3.2.2 documentation, library reference, multiprocessing (3rd example).
My systems details are: MS windows xp or Windows 7, IDLE, Python 3.2.2 [MSC v.1500 32 bit (Intel)] on win32
from multiprocessing import Process
import os
def info(title):
print(title)
print('module name:', __name__)
print('parent process:', os.getppid())
print('process id:', os.getpid())
def f(name):
info('function f')
print('hello', name)
if __name__ == '__main__':
info('main line')
p = Process(target=f, args=('bob',))
p.start()
p.join()
#return
#main line
#module name: __main__
#parent process: 1588
#process id: 3700
#but function f doesn't get printed. |
|
Date |
User |
Action |
Args |
2011-10-19 15:28:02 | Ben.thelen | set | recipients:
+ Ben.thelen |
2011-10-19 15:28:02 | Ben.thelen | set | messageid: <1319038082.58.0.169311394229.issue13220@psf.upfronthosting.co.za> |
2011-10-19 15:28:01 | Ben.thelen | link | issue13220 messages |
2011-10-19 15:28:01 | Ben.thelen | create | |
|