title: Problems with reading and writing to text files in python
body: <p>I am trying to take an input and write the input to a text file to keep it stored. However, I can't seem to get the user input written over to the text file. Here is my code:</p>
  
  <pre><code>SaveUsername = open(r"C:\Users\Ty\Desktop\Login_sys\SaveUsername.txt","w+")
  SavePassword = open(r"C:\Users\Ty\Desktop\Login_sys\SavePassword.txt","w+")
  NewUsername = input("Please enter a username: ")
  NewPassword = input("Please enter a password: ")
  SaveUsername.write(NewUsername)
  print (SaveUsername.readline())
  SavePassword.write(NewPassword)
  print (SavePassword.readline())
  </code></pre>
  
  <p>I am printing the readline to see if the code gets written and it never does.  Please help, thanks.</p>