Screenshot of my IDE with the directory
I am very new to python and have already tried googling a fix for this issue, I've also tried other solutions listed on this site and nothing has worked so as a last resort I am making a post asking for help with this, I would like the code to read and write too two files "user.txt" and "passw.txt" both of which are located in the directory of the python file, but python will not see the files at all, I have tried making new files with different names but absolutly no sign of seeing the two files at all, any help is appreciated
as I said I am very new to python and the Code bellow is probably awful but I will still supply it
(the reason for the first few lines was as I originally wrote the code where No = continue, which I later changed my mind on
question1 = input(" Do You Have a User Account? Yes or No ")
if question1 == ('y') or ("Yes") or ("yes") or ("Y"):
question1 = ('n')
elif question1 == ('n') or ("No") or ("no") or ("N"):
question1 = ('y')
else:
print (' That is not an option ')
user = open("user.txt")
read1 = user.read()
passw = open("passw.txt")
read2 = passw.read()
if question1 == ("y"):
user = open("user.txt")
read1 = user.read()
user.close
user = open("user.txt","a+")
x = input("please enter a username ")
user.write("\n")
user.write(x)
passw = open("passw.txt")
read2 = passw.read()
passw.close
passw = open("passw.txt","a+")
x = input("please enter a password ")
passw.write("\n")
passw.write(x)
else:
print(" wait a second please")
score = (0)
user = input("please enter your username ")
user = open("user.txt","r")
read1 = user.read()
if user in read1:
print("yes")
score =+ (1)
user.close()
else:
print("no")
if score == (1):
print("Please Continue")
any help is appriciated
already tried googling a fix for this issue, I've also tried other solutions listed on this site and nothing has worked so as a last resort I am making a post asking for help with this, I would like the code to read and write too two files "user.txt" and "passw.txt" both of which are located in the directory of the python file, but python will not see the files at all, I have tried making new files with different names but absolutely no sign of seeing the two files at all, any help is appreciated