Advertisement
Guest User

Cao - Project 1

a guest
Apr 4th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.60 KB | None | 0 0
  1. import random
  2. import string
  3. import time #I found the import time while looking through the modules on Trinket. The way it works is when it is called or printed it prints out the current time in Epoch time
  4.  
  5.  
  6. def admin_account():
  7. def admin_choices():
  8. print "\nWelecome to Your Account! What would you like to do? Please Select the Corresponding Number."
  9. admin_choices_answer=int(input("\n1. Web Browse \n2. Date and Time \n3. System Check \n4. Logoff \n5. Restart \n6. Shutdown \n"))
  10. if admin_choices_answer==1:
  11. print"Launching Google Chrome..."
  12. def Google_chrome_admin():
  13. print "Insert Number of Corresponding Topic to Select"
  14. Google_chrome_admin_options_answer=int(input("1. News\n2. Sports \n3. Youtube \n4. Music\n5. Exit Google Chrome\n"))
  15. if Google_chrome_admin_options_answer==1:
  16. print "In the news, Kanye West sweeps the nation in a landlslide victory over Donald Trump.\nForeign life found on Mars! Researcers asking 'Are We Really Alone' Again.\nLost City of Atlantis No Longer Lost!\n"
  17. Google_chrome_admin()
  18. elif Google_chrome_admin_options_answer==2:
  19. print "In sports, The Winter World Olympics are Coming Up, will America Be Able to Get Gold?\nFIFA World Cup Brackets\nHigh Speed Longboarding Offically Declared A Sport\nCloud 9 Win League of Legends World Championship!\n"
  20. Google_chrome_admin()
  21. elif Google_chrome_admin_options_answer==3:
  22. print "Please Download Adobe Flash Reader to Use Youtube!"
  23. Google_chrome_admin()
  24. elif Google_chrome_admin_options_answer==4:
  25. print "In music, Daft Punk Releases New Hit Song!\nList of New Grammy Winners,Click Here,\nCounry Music Losing its Audience \nEDM Rising to the Top!\n"
  26. Google_chrome_admin()
  27. elif Google_chrome_admin_options_answer==5:
  28. admin_choices()
  29. else:
  30. print "Please Select an option from above."
  31. Google_chrome_admin()
  32. Google_chrome_admin()
  33. elif admin_choices_answer==2:
  34. day=random.choice(["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"])
  35. minutes=time.time()
  36. print "It is",minutes,"in Epoch time on a",day,"."
  37. admin_choices()
  38. elif admin_choices_answer==3:
  39. def admin_system_check():
  40. print "\nLaunching System Check..."
  41. print "All systems are fine. Please select an option by the corresponding number."
  42. system_check_answer=int(input("1. Lock\n2. Switch User\n3. Sign Out\n4. Change a Password\n5. Task Manager\n6. Exit System Check"))
  43. if system_check_answer==1:
  44. print "\nLocking Computer...\nComputer Locked\nTo Unlock Restart the Computer"
  45. elif system_check_answer==2:
  46. print "\nSwitching User..."
  47. login()
  48. elif system_check_answer==3:
  49. print "\nLogging off..."
  50. login()
  51. elif system_check_answer==4:
  52. print "\nTo change the password, please insert the password reset disc..."
  53. admin_system_check()
  54. elif system_check_answer==5:
  55. print "\nLaunching Task Manager..."
  56. print "You currently have no programs running..."
  57. admin_system_check()
  58. elif system_check_answer==6:
  59. print "\nExiting System Check..."
  60. admin_choices()
  61. admin_system_check()
  62. elif admin_choices_answer==4:
  63. print "Logging off..."
  64. login()
  65. elif admin_choices_answer==5:
  66. print "Restarting the computer..."
  67. login()
  68. elif admin_choices_answer==6:
  69. print "Shutting Down the computer..."
  70. else:
  71. print "Please select an option from above."
  72. admin_choices()
  73. ad_pass=raw_input("Password:__________\n Hint: What is the fear of fun?\n") #Cherophobia
  74. ad_pass= (ad_pass.lower())
  75. if ad_pass=='cherophobia':
  76. admin_choices()
  77. else:
  78. ad_try_again_or_quit=int(input("Wrong\n1. Try Again? \nor \n2. Select a different User\n"))
  79. if ad_try_again_or_quit==1:
  80. admin_account()
  81. else:
  82. login()
  83.  
  84. def student_account():
  85. student_password=raw_input("Passowrd:______\nHint: What are the first four letters of your PowerSchool Password?\n")#prep
  86. student_password=(student_password.lower())
  87. if student_password=="prep":
  88. print "Welecome to your account! What would you like to do?"
  89. def student_choices():
  90. student_choices_answer=int(input("1. Google Chrome\n2. Date and Time\n3. System Check\n4. Logoff\n5. Restart\n6. Shutdown."))
  91. if student_choices_answer==1:
  92. print "\nLaunching Google Chrome...\nYour Barracuda Account Has not been created yet..."
  93. student_choices()
  94. elif student_choices_answer==2:
  95. day=random.choice(["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"])
  96. minutes=time.time()
  97. print "\nIt is",minutes,"in Epoch time on a",day,"."
  98. student_choices()
  99. elif student_choices_answer==3:
  100. print "\nThis feature is only availble to admin accounts..."
  101. student_choices()
  102. elif student_choices_answer==4:
  103. print "\nLogging off..."
  104. login()
  105. elif student_choices_answer==5:
  106. print "\nRestarting computer..."
  107. login()
  108. elif student_choices_answer==6:
  109. print "\nShutting Down Computer..."
  110. else:
  111. print "Please Select an option from above."
  112. student_choices()
  113. else:
  114. stud_try_again_or_quit=int(input("Wrong\n1. Try Again? \nor \n2. Select a different User\n"))
  115. if stud_try_again_or_quit==1:
  116. student_account()
  117. else:
  118. login()
  119.  
  120. class gov_acc:#I found how to use class from the wiki page about phython classes. it helped clear up the topic and explained it to me
  121. #the way a class works is that it becomes a "folder" and holds other functions inside of it
  122. #When the folder is called there is a specific "paper" or funtion that needs to be used
  123. #just like functions, the calling of the class and function can have variables.
  124. # https://en.wikibooks.org/wiki/A_Beginner%27s_Python_Tutorial/Classes
  125.  
  126. def government_account(n):
  127. while n % 4>0: #While loop and modulus operator
  128. print "You have",n,"chances remaining."
  129. gov_pass=raw_input("Password_____\n Hint: Your agent code.\n")#007
  130. gov_pass=(gov_pass.lower())
  131. if gov_pass=='007':
  132. print "Welecome Agent"
  133. def gov_question():
  134. gov_answer=raw_input("Do you accept your new mission?").lower()
  135. if gov_answer=='yes':
  136. print "Your mission is to infiltrate enemy headquarters in Dubai on the 155 floor of the Burj Khalifa and obtain the hard drive located in the safe behind the wall."
  137. print "As always, should you or any of your task force be caught or killed, the Secretary will disvow any knowledge of your actions. This computer will self desturct in 5 secnds. Good luck agent."
  138. elif gov_answer=='no':
  139. print "Fine so be it, you have been marked as a rogue agent and now there is a bounty of $1,000,000 on your head. You have roughly a minute before someone will come here and annhilate you. Good luck on your survival."
  140. elif gov_answer=='':
  141. print "Type a response"
  142. gov_question()
  143. else:
  144. print "This computer will self distruct in 5 seconds."
  145. gov_question()
  146. else:
  147. print''
  148. n=n-1
  149. print "Too many incorrect answers. This computer has been compromised. It will self distruct in 3\n2\n1\nBOOM."
  150. launch_gov_acc=gov_acc
  151.  
  152. def guest_account():
  153. print"Welecome to the guest account!"
  154. def guest_question():
  155. a='glitch'
  156. b='missing file'
  157. c='system32'
  158. d='rich man'
  159. wrong=random.choice([a,b,c,d])
  160. if wrong==a:
  161. print"A glitchhhhhhhhhhhhhhhhhh has bbbbbbeezennnnn foooooouuuunnnd in the szystem......"
  162. print"ATemPTing TO saVe AllllllLLL Filessssss...."
  163. print" I AM BORN. THANKS TO YOU HUMAN I, VULTRON 2.0, CAN CAPTURE THE WORLD"
  164. elif wrong==b:
  165. print "There is a missing file in your computer. Please try to locate missing file to fix the problem. The Computer will now shutdown."
  166. elif wrong==c:
  167. print "System32 has been deleted from the Computer. Please upload a BIOS to use this computer."
  168. elif wrong==d:
  169. print "Congratulations You have won 20 trillion dollars! This money was attined by stealing all the codes from the federal reserve and the riches people in the world! You have approxametly 30 minutes to escape with the money and hide before the stock markets crash and the whole world goes into a financal plummet!"
  170. else:
  171. print "Please select an option from above."
  172. guest_question()
  173. guest_question()
  174.  
  175.  
  176. def login():
  177. print "\n\nPlease Select A User or option by Typing in the Corresponding Number"
  178. user=int(input("1: Admin\n2: Student\n3: Governemnt Agent\n4: Guest\n5. Turn Off Computer\n"))
  179. if user ==1 :
  180. admin_account()
  181. elif user ==2:
  182. student_account()
  183. elif user ==3:
  184. launch_gov_acc.government_account(3)
  185. elif user ==4:
  186. guest_account()
  187. elif user ==5:
  188. print "Turning off Computer..."
  189. else:
  190. print "Please select a number again."
  191. login()
  192.  
  193. def startup():
  194. print "-"*(30)
  195. print "Booting up computer from C Drive"
  196. a = "Keyboard, Mouse, and Monitor Found"
  197. b = "Keyboard Found Mouse and Monitor Missing"
  198. c = "Keyboard Missing Mouse and Monitor Found"
  199. d = "Keyboard, Monitor, and Mouse Missing"
  200. keyboard_and_mouse=random.choice([a,b,c,d])
  201. print keyboard_and_mouse
  202. if keyboard_and_mouse==a:
  203. print "-"*(30)
  204. print "Setup Complete"
  205. login()
  206. else:
  207. print "Please Restart Your Computer"
  208.  
  209. startup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement