My program needs to read an external Notepad (.txt) file which has usernames and passwords. (Both the program and the document are on my desktop.) I used this code to read it.
file = open ("userDetails.txt", "r")
userDetails = file.readlines()
file.close()
But I keep getting this error:
FileNotFoundError: [Errno 2] No such file or directory: 'userDetails'
I tried putting them in a folder together, but still got the same error. Any ideas?