What's the difference between 'r+' and 'a+' when open file in python?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1466000/python-open-built-in-function-difference-between-modes-a-a-w-w-and-r">python open built-in function: difference between modes a, a+, w, w+, and r+?</a>  </p>
</blockquote>



<p>I have try <code>r+</code> and <code>a+</code> to open file and read and write, but 'r+' and 'a+' are all append the str to the end of the file.</p>

<p>So, what's the difference between <code>r+</code> and <code>a+</code> ?</p>

<hr>

<p>Add:</p>

<p>I have found the reason: </p>

<p>I have read the file object and forgot to seek(0) to set the location to the begin</p>
