Hello World!! I am a computer science major and will be starting my first programming class in 3 weeks. The class focuses on Python and I believe we will be using Python 3. In the meantime I have started learning Python 3 on my own and I am developing a small program to help my classmates in calculus 1 next semester. Everything is going fine with the program so far but I was wondering if anyone had any advice on how to code a user name and password setup feature into a program. I have already set up a user name and password for the program but thus far it is only my username and password that I have written into the code.
Any help would be greatly appreciated.
Thanks,
Learin
Comments
I am looking to do the same, so if you have any luck please let me know.
This has been the most helpful code I've found so far.
Sample log in screen (not usable yet)
global status #status needs to be global for the while statement to function.
# if it's not global you will be stuck in a login loop.
users = {}
status = ""
def displayMenu():
status = raw_input("Are you a registered user? y/n? Press q to quit:")
if status == "y";
oldUser()
elif status == "n":
newUser()
def newUser():
createLogin = raw_input("Create login name:")
def oldUser():
login = raw_input("Enter login name: ")
passw = raw_input("Enter password: ")
while status != "q":
status = displayMenu()