title: opening multiple files
body: <p>I would like to open multiple files with the file names changed little.</p>
  
  <p>For example , I want to open </p>
  
  <pre><code>abc.001.xyz.010.trj
  </code></pre>
  
  <p>After some operation onto the data file I want to save the results into file:</p>
  
  <pre><code>out.abc.001.xyz.010.trj.dat
  </code></pre>
  
  <p>And this process should go on until 10 files.</p>
  
  <p>I know how to open this file</p>
  
  <pre><code>readfile = abc.001.xyz.010.trj
  f = open(readfile, "r")
  </code></pre>
  
  <p>later I tried to write into file</p>
  
  <pre><code>outfile = out.readfile
  f = open(outfile, "w")
  </code></pre>
  
  <p>but I fail. Expect to get output file as</p>
  
  <pre><code> out.abc.001.xyz.010.trj.dat
  </code></pre>
  
  <p>for every loop.</p>
  
  <p>Thanks.</p>