title: studying parallel programming python
body: <pre><code>import multiprocessing
  from multiprocessing import Pool
  from source.RUN import*
  
  def func(r,grid,pos,h):
      return r,grid,pos,h
      p = multiprocessing.Pool()  # Creates a pool with as many workers as you have CPU cores
      results = []
  
  
  if __name__ == '__main__':
      for i in  pos[-1]&lt;2:
      results.append(Pool.apply_async(LISTE,(r,grid,pos[i,:],h)))
      p.close()
      p.join()
  
  for result in results:
      print('liste', result.get())
  </code></pre>
  
  <p>I want to create Pool for <code>(LISTE,(r,grid,pos[i,:],h))</code> process and <code>i</code> is in pos which is variable in different file which is a <code>ndarray[]</code> and I have to call this whole function in another file in between one While Loop. but this code gives error and if I am using 
  <code>if __name__ == '__main__':</code>
  it will not pass through below the <code>if __name__ == '__main__':</code> module
  please give me idea how I can make it</p>