Search and write lines of multiple strings in python?
<pre><code>def info(): #Here you can write your password and username.
 Username = raw_input ("Username: ")
 Password = raw_input ("Password: ")
 print("")
 for line in open('/home/hello/Usernames.txt'):
  if Username == Username in line: #Checks if username is available.
   print ("Username is already taken!\n")
   info()
  else: 
   User = open("/home/hello/Usernames.txt", "w") #Registers username.
   User.write(Username)
   Psw = open("/home/hello/Passwords.txt", "w") #Registers password.
   Psw.write(Password)
   print ("You have succsesfully registered!") #If you managed to register.
   break 

info()
</code></pre>

<p>This is an account registerer that can register both username and password. But I need help with something... How can I make it check multiple lines of strings in a file, and how can I make the program write a new line of string in the text files when I register without replacing the old string?</p>
