Advertisement
Guest User

Untitled

a guest
Aug 8th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1. import os
  2. import time
  3. def clearscreen(numlines=100):
  4.     if os.name == "posix":
  5.     # Unix/Linux/MacOS/BSD/etc
  6.         os.system('clear')
  7.     elif os.name in ("nt", "dos", "ce"):
  8.     # DOS/Windows
  9.         os.system('CLS')
  10.     else:
  11.     # Fallback for other operating systems.
  12.         print '\n' * numlines
  13.  
  14.  
  15. loop = 1
  16. users = []
  17.  
  18. while loop == 1:
  19.     clearscreen()
  20.     print "Welcome to yerer's login screen"
  21.     print " "
  22.     choice = input("1. Login\n2. Create account\n3. Exit\nq")
  23.     if choice == 2:
  24.         clearscreen()
  25.         print "New Account"
  26.         users.append([raw_input("Username: "), raw_input("Password: ")])
  27.     if choice == 1:
  28.         clearscreen()
  29.         print "Existing User"
  30.         username = raw_input("Username: ")
  31.         password = raw_input("Password: ")
  32.         if [username, password] in users:
  33.             print "Welcome"
  34.             loop == 0
  35.         else:
  36.             clearscreen()
  37.             print "Username and password combination not recognized\n"
  38.             time.sleep(3)
  39.     if choice == 0:
  40.         print "Goodbye"
  41.         loop = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement