title: string append in python
body: <p>i am trying to prepend each line of a file with "   (2 spaces/tabs after ") and append with  string- "\r\n"+". the lines of the file before this operation looks like as folllows.
           </p>
  
  <pre><code>        &lt;!--You have a CHOICE of the next 5 items at this level--&gt;
          &lt;!--Optional:--&gt;
          &lt;urn:Account id=\"?\"&gt;
             &lt;!--Optional:--&gt;
             ............
             .............    
  </code></pre>
  
  <p>I am using the following code,</p>
  
  <pre><code>inf=open("req.txt","r")
  
  outf=open("out.txt","w")
  
  for line in inf.readlines():
  
      outf.write("\"          "+line+"\\r\\n\" +")
  
  inf.close()
  
  outf.close()
  </code></pre>
  
  <p>prepending is happening as expected but appending is not happening properly. Final result was all lines were prepended with - \r\n" +"  except the first line. first line was prepended with only "      . </p>
  
  <p>I want each line prepended with "   and appended with "\r\n"+"</p>