Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import sys
- import getpass
- def login():
- user = input("Username: ")
- passw = getpass._raw_input("Password: ")
- f = open("users.txt", "r")
- for line in f.readlines():
- us, pw = line.strip().split("|", 1)
- if user == us and passw == pw:
- print("Login successful!")
- f.close()
- return True
- print("Wrong username/password")
- return False
- def menu():
- print("Hello there! Before we can start, I need your information!")
- time.sleep(2)
- print("What is your age?")
- age = str(input("Age: "))
- if str.isdigit(age) == True:
- print("Age can not be a string!")
- print("This form will be restarted in 5 seconds!")
- time.sleep(5)
- menu()
- else:
- if age >= 18:
- print("Alright, looks like you are " + age + " years old!")
- time.sleep(2)
- else:
- print("Uh oh! Looks like you are underage!")
- time.sleep(1)
- print("Ask for your parents' consent to continue!")
- time.sleep(1)
- parentConsent = str(input("I have consent from my parents(True or False): "))
- if parentConsent.casefold() == str.casefold("true"):
- print("Great! Now we can continue!")
- time.sleep(2)
- else:
- print("You cannot continue without parents' consent. Program will exit in 8 seconds")
- time.sleep(8)
- sys.exit(["Underage and no parental consent"])
- time.sleep(1)
- print("What is your first name?")
- firstName = str(input("First name: "))
- time.sleep(1)
- print("Great!")
- time.sleep(1)
- print("What is your last name?")
- lastName = str(input("Last name: "))
- time.sleep(1)
- print("Awesome! I see your name is " + firstName + " " + lastName + "!" + " Nice to meet you, my name is FILLER")
- time.sleep(2)
- print("What is your email address?")
- time.sleep(1)
- emailAddress = str(input("Email: "))
- if "@nwytg.net" in emailAddress:
- print("Hey! Not using a real email isn't advised!")
- time.sleep(3)
- print("Looks like your email address is " + str(emailAddress) + "!")
- elif "@" not in emailAddress or "." not in emailAddress:
- print("Enter a valid email next time!")
- time.sleep(1)
- print("Looks like your so called 'email' address is " + emailAddress)
- else:
- print("Great! It seems your email address is " + str(emailAddress))
- time.sleep(1)
- print("What is your phone number?")
- phoneNumber = str(input("Phone number: "))
- print("Alright, I see your phone number is " + str(phoneNumber) + "!")
- time.sleep(1)
- print("Alright, that's it. This program will automatically close in 5 seconds.")
- time.sleep(5)
- sys.exit(["Completed"])
- def main():
- while True:
- log = login()
- if log == True:
- menu()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement