I'm trying to save login info to a .txt file from inputs stored in a dict which i have done successfully but when try add a second set of login info it rewrites the existing login info instead of adding it to the file in a new line. This is the code i have. please forgive me if this is a simple answer i'm sorta new I'm using python 3
login_info = {
"login_site": "blank",
"username": "blank",
"password": 1234
}
login_location = input('What site/app is this login info used for?')
user_define = input('What is your Username?')
password_define = input('What is your password')
login_info["login_site"] = login_location
login_info["username"] = user_define
login_info["password"] = password_define
with open(r"C:\MyTextFile\login.txt", "w+") as file:
file.write(str(login_info))
file.close()