Abhishek Manandhar added the comment:
Yes actually it produce no erroe on standalone script. But the script
executes without any outputs. not even for numpy function. I used code
below in script.
import multiprocessing
import numpy
def f(x):
return x*x
if __name__ = "__main__":
p= multiprocessing.Pool(5)
print p.map(numpy.sqrt,[1,2,3,4])
print p.map(f,[1,2,3,4])
On May 15, 2015 2:52 PM, "Paul Moore" <[email protected]> wrote:
>
> Paul Moore added the comment:
>
> Multiprocessing works by firing up additional processes. Those processes
> won't have access to functions defined in the interactive interpreter.
>
> Can you reproduce this problem in a standalone script? I suspect not, but
> if you can please post the script here.
>
> Marking as "not a bug", but I haven't closed it yet in case a script
> reproducing the issue can be provided.
>
> ----------
> nosy: +paul.moore
> resolution: -> not a bug
>
> _______________________________________
> Python tracker <[email protected]>
> <http://bugs.python.org/issue24202>
> _______________________________________
>
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue24202>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com