Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- def clearscreen(numlines=100):
- if os.name == "posix":
- # Unix/Linux/MacOS/BSD/etc
- os.system('clear')
- elif os.name in ("nt", "dos", "ce"):
- # DOS/Windows
- os.system('CLS')
- else:
- # Fallback for other operating systems.
- print '\n' * numlines
- loop = 1
- users = []
- while loop == 1:
- clearscreen()
- print "Welcome to yerer's login screen"
- print " "
- choice = input("1. Login\n2. Create account\n3. Exit\nq")
- if choice == 2:
- clearscreen()
- print "New Account"
- users.append([raw_input("Username: "), raw_input("Password: ")])
- if choice == 1:
- clearscreen()
- print "Existing User"
- username = raw_input("Username: ")
- password = raw_input("Password: ")
- if [username, password] in users:
- print "Welcome"
- loop == 0
- else:
- clearscreen()
- print "Username and password combination not recognized\n"
- time.sleep(3)
- if choice == 0:
- print "Goodbye"
- loop = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement