I'm trying to figure out how to list user inputs without overwriting the previous text inputted, but instead adding more into it infinitely.
This is my code so far:
def main():
domain=input('Enter domain: ')
email=input('Enter your email or username: ')
password=input('Enter your password: ')
text_file = open("Data.txt", "w")
text_file.write("Domain of login: "+domain+'\n'+"Email/username:
"+email+'\n'+"Password: "+password)
text_file=open("Data.txt", "r")
text = text_file.read()
print(text)
text_file.close()
main()
This is the output example:
Domain of login: Facebook.com
Email/username: 1234567@email.com
Password: pas5word
This is the concept I'm trying to aim for:
Domain of login: Facebook.com
Email/username: 1234567@email.com
Password: pas5word
Domain of login: Youtube.com
Email/username: 1234567@email.com
Password: pas5word2
Domain of login: Twitter.com
Email/username: 54321@email.com
Password: pas5word3