It's not very sophisticated or anything, but I'm trying to add an authorization feature.
I'm basically just using a .txt file to store passwords and their corresponding names, but I'm having trouble with an error I keep getting telling me that a variable is not defined. Here's the relevant code:
global name for line in "logins.txt": if password in line: loginLine = line.split('\t\t') name = loginLine
Anyway, it keeps saying that name is not defined, even though I tried a bunch of different ways to make it global. Does anyone know how to make a variable like that global? Also, because the code I used to find the password/name combo in the .txt file is somewhat bad, if you think of a better way to do it (that involves a text file that can be manipulated (theoretically) by an office manager or seomthing) then please, let me know.
If I left out anything important, let me know.
Also, I'm very much a beginner at python, so don't ridicule me too much.
Thanks a bunch,