title: run a python script in qsub
body: <p>I have a python script <code>main_script.py</code> that looks like this:</p>
  
  <pre><code>import os
  
  Files = os.listdir(os.path.join(path, "."))
  FilesNumber = len(Files)
  
  for fileID in range (0,FilesNumber):
      filename = Files[fileID]
  
      # load file specified in filename and do stuff
  </code></pre>
  
  <p>basically it does the same kind of operations for each file in the variable <code>Files</code></p>
  
  <p>I would like to use qsub to parallelize the for loop.</p>
  
  <p>Assuming that I have a txt file <code>files.txt</code> containing all the files names:</p>
  
  <pre><code>//mypath//pathfile1
  //mypath//pathfile2
  ...
  //mypath//pathfile100
  </code></pre>
  
  <p>how can I write the shell script that calls qsub and runs <code>main_script.py</code>
  I think that I would also need to adapt <code>main_script.py</code> but I do not know how...</p>
  
  <p>The scheduler is Torque/Maui</p>