title: Why does pool run the entire file multiple times?
body: <p>I'm trying to understand the output from this Python 2.7.5 example script:</p>
  
  <pre><code>import time
  from multiprocessing import Pool
  
  print(time.strftime('%Y-%m-%d %H:%M', time.localtime(time.time())))
  props2=[
              '170339',
              '170357',
              '170345',
              '170346',
              '171232',
              '170363',
              ]
  def go(x):
       print(x)
  
  if __name__ == '__main__':
      pool = Pool(processes=3)
      pool.map(go, props2)
  
  print(time.strftime('%Y-%m-%d %H:%M', time.localtime(time.time())))  
  </code></pre>
  
  <p>This yields the output:</p>
  
  <blockquote>
    <p>2015-08-06 10:13</p>
    
    <p>2015-08-06 10:13</p>
    
    <p>2015-08-06 10:13</p>
    
    <p>170339</p>
    
    <p>170357</p>
    
    <p>170345</p>
    
    <p>170346</p>
    
    <p>171232</p>
    
    <p>170363</p>
    
    <p>2015-08-06 10:13</p>
    
    <p>2015-08-06 10:13</p>
    
    <p>2015-08-06 10:13</p>
  </blockquote>
  
  <p>My questions are:</p>
  
  <p>A)  Why does the time print three times at the beginning and the end?  I would have expected it to print the start time, and then the end time. </p>
  
  <p>B)  The real question - How do I get it to run one command multiple times, but all the others a single time?  </p>