title: Python - Reading an integer from a file and replacing it on the same file after its manipulation
body: <p>I am trying to read a number from a text file, add 1 to this number and then overwrite the old number with the new number in python</p>
  
  <pre><code>file = open('group_count','w+')# opens the text file which contains a number
  groupcount = file.read()    # reads the number
  i = int(groupcount)     # supposed to convert the number from the text file to an interger
  groupcountnew=groupcount+1  # supposed to 'add one' to that number in the text file
  file.write(groupcountnew) # will write that new number to the text file, overriding the original number
  </code></pre>
  
  <p>It is not working, can someone help please !</p>