title: Getting "Can only concatenate str (not "int") to str" when adding to a value read from a file
body: <p>I would like the bots.txt to be read as an <strong>int</strong> instead of an <strong>str</strong>. However none of the  videos i find on the internet help, or go into major detail on how I can solve this issue.</p>
  <p>Here is my code</p>
  <pre><code>import time
  import os
  import random
  os.system('mode 88,30')
  with open('B://JakraG2//.Bots//bots.txt', 'r') as f:
      aaa = f.read()
  counter = aaa
      while True:
      time.sleep(0.05)
      print(&quot;Added 1 to bots.txt&quot;)
      counter = counter + 1
      lel = &quot;{}&quot;.format(counter)
      with open('B://JakraG2//.Bots//bots.txt', 'w') as f:
          f.write(&quot;{}&quot;.format(lel))
  </code></pre>
  <p>Here is the error</p>
  <pre><code>Traceback (most recent call last):
    File &quot;loader.py&quot;, line 16, in &lt;module&gt;
      counter = counter + 1
  TypeError: can only concatenate str (not &quot;int&quot;) to str
  </code></pre>
  <p>bots.txt</p>
  <pre><code>0
  </code></pre>