why pool.map in python doesn't work
Question: 
    import multiprocessing as mul
    
    def f(x):
        return x**2
    
    pool = mul.Pool(5)
    rel  = pool.map(f,[1,2,3,4,5,6,7,8,9,10])
    
    print(rel)
    

When I run the program above, the application is stuck in a loop and can't
stop. I am using python 3.5 in windows, is there something wrong?

This is what I see on my screen:

![](http://i.stack.imgur.com/SF5Yo.png)

I am new to finance data analysis; and I am trying to find out a way to solve
the big data problem with parallel computing.


Answer: Its not working because you are typing the commands in a shell; try saving the
code in a file and running it directly.

Don't forget to copy the code correctly, you were missing a very important
`if` statement (see the
[documentation](https://docs.python.org/2/library/multiprocessing.html#introduction)).

Save this to a file, for example `example.py` on the desktop:

    
    
    import multiprocessing as mul
    
    def f(x):
        return x**2
    
    if __name__ == '__main__':
        pool = mul.Pool(5)
        rel  = pool.map(f,[1,2,3,4,5,6,7,8,9,10])
    
        print(rel)
    

Then, open a command prompt and type:

    
    
    python %USERPROFILE%\Desktop\example.py
    

