title: Multiprocessing a for loop?
body: <p>I have an array (called <code>data_inputs</code>) containing the names of hundreds of astronomy images files. These images are then manipulated. My code works and takes a few seconds to process each image. However, it can only do one image at a time because I'm running the array through a <code>for</code> loop:</p>
  
  <pre><code>for name in data_inputs:
      sci=fits.open(name+'.fits')
      #image is manipulated
  </code></pre>
  
  <p>There is no reason why I have to modify an image before any other, so is it possible to utilise all 4 cores on my machine with each core running through the for loop on a different image?</p>
  
  <p>I've read about the <code>multiprocessing</code> module but I'm unsure how to implement it in my case.
  I'm keen to get <code>multiprocessing</code> to work because eventually I'll have to run this on 10,000+ images.</p>