def runlogin():
if choice1 == "yes":
username=input("Enter your username")
password=input("Enter your password")
file = open("logins.txt","r")
if (file.readline()) == (username+":"+password):
print("Access Granted")
else:
print("Access Denied")
print("Welcome")
choice1=input("Have you already created an account? ('yes' or 'no')")
choice1=choice1.lower()
if choice1 == "no":
createusername=input("Please enter a username")
createpassword=input("Please enter a password")
filefile=open("logins.txt","a")
filefile.write(createusername+":"+createpassword)
print("Account created, redirecting to login page")
filefile.close()
if choice1 == "yes":
runlogin()
When the users chooses "no", they are then prompted to create an account. My issue is, when they input their details and then create the account, nothing is added to the text file
The text file is formatted like "username:password"
No syntax error occurs