I'm doing a simple login system and it saves usernames and passwords in a dictionary (for now). Does closing the program delete any new user info added when running the program? I want my users to be able to log back in with the same credentials they set up when previously using the program.
import getpass
usersdict = {
"admin" : "admin",
}
def signUp():
print("\nTo make a new account you must create your own unique username and password\n\n***\n\n")
while True:
newUsername = str(input("Enter your username:\n"))
newPassword = getpass.getpass(prompt = "Enter your password: ", stream = None)
passConfirm = getpass.getpass(prompt = "Confirm your password: ", stream = None)
if passConfirm == newPassword:
userdict[newUsername] = newPassword
print("\n Great! Your data has been confirmed and will now be saved to the database. To play the game restart the program then login.")
#Here the user data should be saved some way that makes sure it is not deleted and can be retrieved when restarting program
else:
print("Please re-enter your credentials.")