title: Using Multiprocessing Pool from an Interactively loaded module
body: <p>I have a Python module `mymodule'</p>
  
  <pre><code># mymodule.py
  import multiprocessing as mp
  
  def do_work(x):
    # do some stuff
    return 42+x
  
  def work():
    pool = mp.Pool()
    work_list= [1,2,3,4,5]
    returned_values = pool.map(do_work, work_list)
    pool.close()
  
  #end mymodule
  </code></pre>
  
  <p>I want to import this interactively in a Python shell and invoke <code>work()</code> like this</p>
  
  <pre><code> In [1]: import mymodule as mm
   In [2]: mm.work()
  </code></pre>
  
  <p>If I do this the <code>do_work</code> does not seem to be doing anything. How can I make this work in an interactive shell. If I turn the above into a non-interactive script I face no problems. I am on Windows.</p>