Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global usernameInput
- global passwordInput
- global username1
- global password
- import random
- import time
- def title():
- print(" ______ _____ _____ _____ ______ ___ _____ _____ ")
- print(" | _ \_ _/ __ \| ___| | ___ \/ _ \/ __ \| ___| ")
- print(" | | | | | | | / \/| |__ | |_/ / /_\ \ / \/| |__ ")
- print(" | | | | | | | | | __| | /| _ | | | __| ")
- print(" | |/ / _| |_| \__/\| |___ | |\ \| | | | \__/\| |___ ")
- print(" |___/ \___/ \____/\____/ \_| \_\_| |_/\____/\____/ ")
- print("---------------------------------------------------------------------------------------------------------------")
- choice = input("Type Start to start")
- if choice == "Start":
- ##takes user to the login screen
- loginUser1()
- else:
- title()
- def loginUser1():
- ##login for first user
- global usernameInput
- global username1
- print("Please log in using your correct username")
- print("-----------------------------------------")
- usernameInput = input("Username:") ##enter username
- usernamedb = open("usernamedb.txt","r") ##open file and reaf usernames
- name = usernamedb.read()
- username1 = name
- if username1 in name: ##checking to see if the username entered matches a username in the file
- usernamedb.close() ##closes file
- loginPass1()
- else:
- usernamedb.close()
- time.sleep(3) ##sets a delay of 3 seconds
- loginUser1()
- def loginPass1():
- global passwordInput
- global password
- print("Please log in using the correct password")
- print("----------------------------------------")
- passwordInput = input("Password:") ##enter password
- passworddb = open("passworddb.txt","r") ##open file
- passphrase = passworddb.read()
- password = passphrase
- if password in passphrase: ##checking to see if the username entered matches a username in the file
- passworddb.close() ##close the file
- loginUser2()
- else:
- passworddb.close()
- time.sleep(3) ##sets a delay of 3 seconds
- loginUser1()
- def loginUser2():
- global usernameInput
- global username1
- print("Please log in using your correct username")
- print("-----------------------------------------")
- usernameInput = input("Username:") ##emter second username
- usernamedb = open("usernamedb.txt","r") ##open file
- name = usernamedb.read()
- username2 = name
- if username2 == username1: ##checks if username 2 is the sam eas username 1
- usernamedb.close() ##closes file
- time.sleep(3) ##sets a delay of 3 seconds
- loginUser2()
- elif username2 in name: ##checking to see if the second username entered matches a username in the file
- usernamedb.close()
- loginPass2()
- else:
- usernamedb.close()
- time.sleep(3)
- loginUser2()
- def loginPass2():
- global passwordInput
- global password
- print("Please log in using the correct password")
- print("----------------------------------------")
- passwordInput = input("Password:") ##enter password
- passworddb = open("passworddb.txt","r") ## open file
- passphrase = passworddb.read()
- password = passphrase
- if password in passphrase: ##checking to see if the username entered matches a username in the file
- passworddb.close() ##close the file
- game()
- else:
- passworddb.close()
- time.sleep(3) ##sets a delay of 3 seconds
- loginUser2()
- def game():
- print("ay")
- title()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement