title: How can I take a value from a document and add another value to it?
body: <p>I have a Python program I'm writing that I would like to have track statistics given inputs. I'd like it to have two documents set up, and be able to refer to each. In each, there would be a value, let's say it's <em>x</em>. The program would be able to generate a number, and I'd like to be able to update the number in a given document by <em>adding</em> the generated number. Right now, my code would be as follows:</p>
  
  <pre><code>f1 = open("player1records.txt", "a+")
  
  f1.write(str(int(P1wins) + int(f1.read)))
  </code></pre>
  
  <p>This, however, raises the following:</p>
  
  <pre><code>TypeError: int() argument must be a string, a bytes-like object or a number, 
  not 'builtin_function_or_method'
  </code></pre>
  
  <p>How can I take that <em>x</em> and add another number to it, then update the document?</p>