title: Running different codes with python
body: <p>I am working on a project where i need to run a code thousands of times with different arguments. like </p>
  
  <pre><code> gringo some_random_SAT.lp --const n=i |clasp 0
  </code></pre>
  
  <p>Hhere I need to keep changing <code>i</code> to from say 1 to 500 and take the information that <code>some_random_SAT.lp</code> outputs, then I need to do the same for a c++ code that I have.  Writing all the data to a file. My question is how to do this.</p>
  
  <p>I am not asking for some one to tell me how to do it all, I just would like to know a good book or some where to learn how to do similar things such as this. </p>
  
  <p>I am not attached to python if perl would work better i can do that. </p>
  
  <p>Im running Linux if that makes any difference.</p>