title: Python - Edit specific cell in CSV file
body: <p>I have created a quiz game in Python that also contains a login and register program however I'm trying to add a scoring system.</p>
  
  <p>Currently, I have the CSV file set out like this:</p>
  
  <pre><code>username,password,score
  </code></pre>
  
  <p>When you create an account the score is set to 0 and is loaded when you log in using: </p>
  
  <pre><code>for row in users:
       if username == row[0]:
           currentScore = row[2]
           currentScore = int((currentScore))
  </code></pre>
  
  <p>This grabs the users high score from the CSV file.
  However when a game finishes I have this setup to determine if their new score is higher than there old score or not: </p>
  
  <pre><code>if int(score) &gt; int(currentScore):
      currentscore = score
  </code></pre>
  
  <p>I then need it to open the database and find the user that is playing and update there score with the new one. How would I do this? I have tried to get csv to edit a certain row but it doesn't seem to work.</p>
  
  <p>Full code can be found here:<a href="https://pastebin.com/q07qazJA" rel="nofollow noreferrer">https://pastebin.com/q07qazJA</a></p>