Guest User

Untitled

a guest
Dec 25th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.37 KB | None | 0 0
  1. import time
  2. import sys
  3. import webbrowser
  4. import os.path
  5.  
  6. if os.path.exists('hackforums.txt'):
  7.     openfilex = open('hackforums.txt')
  8.     content = openfilex.read()
  9.     splitcontent = content.split(':') #To cut it into 2 parts
  10.     userName = raw_input("Username: ")
  11.     admnName = splitcontent[0]
  12.  
  13.     if str(userName) == str(admnName):      
  14.  
  15.         userPass = raw_input("Password: ")
  16.         realPass = splitcontent[1]
  17.        
  18.         if str(userPass) == str(realPass):
  19.             print "Valid Login."
  20.             print "Thanks for DLing my first Program. - Overf1eld"
  21.             exitNow = ''
  22.             while exitNow != "y" or "n":
  23.            
  24.                 exitNow = raw_input("Exit now? If you want to look at the other parts, you will need to restart, i \n have no idea how to make it so you dont have to. -.-  <y/n> ")
  25.                
  26.                 if str(exitNow) == "y":
  27.                     print "Shutting Down"
  28.                     time.sleep(2)
  29.                     sys.exit(1)      
  30.                
  31.                 if str(exitNow) == "n":
  32.                     print "Have fun staring at me."
  33.                    
  34.                 else:
  35.                     print "Invalid choice, please choose either <y>/<n>"
  36.         else:
  37.             print "Wrong password!!<y/n>"
  38.             time.sleep(1)
  39.             print "Shutting Down"
  40.             time.sleep(.5)
  41.             sys.exit(1)
  42.  
  43.     else:
  44.         print "Wrong Username!!!"
  45.         time.sleep(1)
  46.         print "Shutting Down"
  47.         time.sleep(.5)
  48.         sys.exit(1)
  49.    
  50.    
  51. else:
  52.     print "You have no account yet! <y/n>"
  53.     createaccInput = ''
  54.     while createaccInput != 'n' or 'y':
  55.        
  56.         createaccInput = str(raw_input("Would you like to create one y/n \n"))
  57.         if str(createaccInput) == "y":
  58.             openfilex = open('hackforums.txt', 'w')
  59.             usernamex = raw_input("What will your username be? \n")
  60.             passwordxz = raw_input("What will your password be? \n")
  61.             openfilex.write(usernamex + ':' + passwordxz)
  62.             print "You have created An Account!"
  63.             time.sleep(5)
  64.             sys.exit(1)
  65.            
  66.  
  67.         if str(createaccInput) == "n":
  68.             print "Shutting Down"
  69.             time.sleep(.5)
  70.             sys.exit(1)
  71.        
  72.         else:
  73.             print "Invalid choice, please choose either <y>/<n>"
Add Comment
Please, Sign In to add comment