title: TypeError: an integer is required (got type str), A high score saving function
body: <p>I'm currently trying to create a high score saving function that reads and writes from a file.</p>
  
  <pre><code>self.dir = path.dirname(__file__)
  with open(path.join(self.dir),Highscore_File,"w") as f:
          f.write((self.score))
  </code></pre>
  
  <p>The error I am getting is:</p>
  
  <pre><code>TypeError: an integer is required (got type str)
  </code></pre>
  
  <p>I have tried converting <code>self.dir</code> to an integer but got an even more complex error. </p>