A forum for general discussion of the Python programming language.


Postby honza » Sun Jun 09, 2013 1:07 pm

Good afternoon,

I have problem with basic example of multiprocessing. The, returns error and I do not know why. Problem you can see on picture and here is code:

from multiprocessing import Pool
p = Pool(5)
def f(x):
return x*x, [1,2,3])

Do you now where is a problem, please? Thank you and have a nice day.
error_multi.png (227.59 KiB) Viewed 600 times
Posts: 1
Joined: Sun Jun 09, 2013 12:54 pm

Re: multiprocessing

Postby Yoriz » Sun Jun 09, 2013 6:01 pm

It tells you right before that example that the following example will not work in the interactive interpreter.

Functionality within this package requires that the __main__ module be importable by the children. This is covered in Programming guidelines however it is worth pointing out here. This means that some examples, such as the multiprocessing.Pool examples will not work in the interactive interpreter. For example:
New Users, Read This
Join the #python-forum IRC channel on!
User avatar
Posts: 1588
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 2 guests