Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import random
- import sys
- import csv
- #setting certain values
- menu = 1
- inmenu = 0
- debug = 0
- #globalising certain modules
- global username
- username = "."
- global password
- password = "."
- global check1
- check1 = "."
- global check2
- check2 = "."
- def inmenu():
- print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
- print("")
- print("aaaaaaaaaaa")
- print("")
- print("❶ Login")##Referenced both number symbols from http://coolsymbol.com
- print("❷ Register")
- print("")
- menuchoice = input("Enter your choice: ")
- if menuchoice == "1" or menuchoice == "one" or menuchoice == "login":
- time.sleep(0.3)
- login()
- elif menuchoice == "2" or menuchoice == "two" or menuchoice == "register":
- time.sleep(0.3)
- register()
- else:
- import error#Using another python file I made (/JordanB$/Practical CS/time
- menu()
- def login():
- print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
- print("Let's log in...")
- global check1
- global check2
- global username
- username = input("Enter your username ")
- global password
- password = input("Enter your password ")
- with open('usernames.txt', 'r') as searchfile:
- for line in searchfile:
- if username in line:
- check1 = "complete"
- if check1 == "complete":
- with open('usernames.txt', 'r') as searchfile:
- for line in searchfile:
- if password in line:
- check2 = "complete"
- inmenu()
- if check1 != "complete" or check2 != "complete":
- print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
- print("✦✦✦ Invalid details, please sign up.")
- time.sleep(3)
- # if check2 != "complete":
- # print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
- # print("✦✦✦ Invalid password, please sign up.")
- # time.sleep(3)
- def register():
- print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
- print("Let's sign up...")
- global username
- username = input("Enter your desired username ")
- global password
- password = input("Enter a password ")
- fh = open("usernames.txt","a")
- lines_of_text = [username, " - ", password, "\n"]
- fh.writelines(lines_of_text)
- fh.close()
- print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
- print("✦✦✦ You have successfully registered!")
- time.sleep(3)
- while menu == True:
- print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
- print("")
- print("Katarina's Dice Game")
- print("")
- print("❶ Login")##Referenced both number symbols from http://coolsymbol.com
- print("❷ Register")
- print("")
- menuchoice = input("Enter your choice: ")
- if menuchoice == "1" or menuchoice == "one" or menuchoice == "login":
- time.sleep(0.3)
- login()
- elif menuchoice == "2" or menuchoice == "two" or menuchoice == "register":
- time.sleep(0.3)
- register()
- else:
- import error#Using another python file I made (/JordanB$/Practical CS/time
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement