Advertisement
CaoN

Ca0-Project 1

Apr 7th, 2016
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 12.38 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 '='*30
  9.     print "Welcome to Your Computer"
  10.     print '='*30
  11.     print "\nWelecome to Your Account! What would you like to do? Please Select the Corresponding Number."
  12.     admin_choices_answer=int(input("\n1. Web Browse \n2. Date and Time \n3. System Check \n4. Logoff \n5. Restart \n6. Shutdown \n"))
  13.     if admin_choices_answer==1:
  14.       print"Launching Google Chrome..."
  15.       def Google_chrome_admin():
  16.         print "Insert Number of Corresponding Topic to Select"
  17.         Google_chrome_admin_options_answer=int(input("1. News\n2. Sports \n3. Youtube \n4. Music\n5. Exit Google Chrome\n"))
  18.         if Google_chrome_admin_options_answer==1:
  19.           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"
  20.           Google_chrome_admin()
  21.         elif Google_chrome_admin_options_answer==2:
  22.           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"
  23.           Google_chrome_admin()
  24.         elif Google_chrome_admin_options_answer==3:
  25.           print "Please Download Adobe Flash Reader to Use Youtube!"
  26.           Google_chrome_admin()
  27.         elif Google_chrome_admin_options_answer==4:
  28.           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"
  29.           Google_chrome_admin()
  30.         elif Google_chrome_admin_options_answer==5:
  31.           admin_choices()
  32.         else:
  33.           print "Please Select an option from above."
  34.           Google_chrome_admin()
  35.       Google_chrome_admin()
  36.     elif admin_choices_answer==2:
  37.       day=random.choice(["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"])
  38.       minutes=time.time()
  39.       print "It is",minutes,"in Epoch time on a",day,"."
  40.       admin_choices()
  41.     elif admin_choices_answer==3:
  42.       def admin_system_check():
  43.         print "\nLaunching System Check..."
  44.         print "All systems are fine. Please select an option by the corresponding number."
  45.         system_check_answer=int(input("1. Lock\n2. Switch User\n3. Sign Out\n4. Change a Password\n5. Task Manager\n6. Exit System Check"))
  46.         if system_check_answer==1:
  47.           print "\nLocking Computer...\nComputer Locked\nTo Unlock Restart the Computer"
  48.         elif system_check_answer==2:
  49.           print "\nSwitching User..."
  50.           login()
  51.         elif system_check_answer==3:
  52.           print "\nLogging off..."
  53.           login()
  54.         elif system_check_answer==4:
  55.           print "\nTo change the password, please insert the password reset disc..."
  56.           admin_system_check()
  57.         elif system_check_answer==5:
  58.           print "\nLaunching Task Manager..."
  59.           print ''
  60.           z= "Google Chrome"
  61.           y= "League of Legends"
  62.           x= "2048"
  63.           def programs():
  64.             print "You currently have %s,%s, and %s running." %(z,y,x)
  65.             task_answer=raw_input("Which program whould u like to close? Please type out the full name of the program.").lower()
  66.             if task_answer=="google chrome":
  67.               print "Closing Google Chrome."
  68.               print ''
  69.               tca=raw_input("Would like to close any more programs, if so which one?").lower()
  70.               if tca=='league of legends':
  71.                 print "Closing League of Legends...\n Exiting task manager..."
  72.                 admin_system_check()
  73.               elif tca=='2048':
  74.                 print "Closing 2048... \n exiting task manager..."
  75.                 admin_system_check()
  76.               else:
  77.                 print "Exiting Task Manager..."
  78.                 admin_system_check()
  79.             elif task_answer=="league of legends":
  80.               print "Closing League of legends"
  81.               print''
  82.               tla=raw_input("Would you like to close any more programs, if so whihc one?").lower()
  83.               if tla=='google chrome':
  84.                 print "Closing League of Legends...\nExiting Task Manager..."
  85.                 admin_system_check()
  86.               elif tla=='2048':
  87.                 print "Closing 2048...\n Exiting Task Manager..."
  88.                 admin_system_check()
  89.               else:
  90.                 print "Exiting Task Manager"
  91.                 admin_system_check()
  92.             elif task_answer=='2048':
  93.               print "Closing 2048"
  94.               print''
  95.               t2a=raw_input("Would you like to close any more programs, if so whihc one?").lower()
  96.               if t2a=='google chrome':
  97.                 print "Closing Google Chrome...\nExiting Task Manager..."
  98.                 admin_system_check()
  99.               elif t2a=='league of legends':
  100.                 print "Closing league of legends...\n Exiting Task Manager..."
  101.                 admin_system_check()
  102.               else:
  103.                 print "Exiting Task Manager"
  104.                 print''
  105.                 admin_system_check()
  106.             else:
  107.               print "\nNot an option or program currently running."
  108.               programs()
  109.               def try_again():
  110.                 try_again=raw_input("Would you like to exit or try again?").lower
  111.                 if try_again=="exit":
  112.                   print "Exiting Task Manager..."
  113.                   admin_system_check()
  114.                 elif try_again=="try again":
  115.                   programs()
  116.                 else:
  117.                   "Not an option. Please try again."
  118.                   try_again()
  119.           programs()
  120.         elif system_check_answer==6:
  121.           print "\nExiting System Check..."
  122.           admin_choices()
  123.       admin_system_check()
  124.     elif admin_choices_answer==4:
  125.       print "Logging off..."
  126.       login()
  127.     elif admin_choices_answer==5:
  128.       print "Restarting the computer..."
  129.       login()
  130.     elif admin_choices_answer==6:
  131.       print "Shutting Down the computer..."
  132.     else:
  133.       print "Please select an option from above."
  134.       admin_choices()
  135.   ad_pass=raw_input("Password:__________\n Hint: What is the fear of fun?\n") #Cherophobia
  136.   ad_pass= (ad_pass.lower())
  137.   if ad_pass=='cherophobia':
  138.     admin_choices()
  139.   else:
  140.     ad_try_again_or_quit=int(input("Wrong\n1. Try Again? \nor \n2. Select a different User\n"))
  141.     if ad_try_again_or_quit==1:
  142.       admin_account()
  143.     else:
  144.       login()
  145.  
  146. def student_account():
  147.   student_password=raw_input("Passowrd:______\nHint: What are the first four letters of your PowerSchool Password?\n")#prep
  148.   student_password=(student_password.lower())
  149.   if student_password=="prep":
  150.     print "Welecome to your account! What would you like to do?"
  151.     def student_choices():
  152.       student_choices_answer=int(input("1. Google Chrome\n2. Date and Time\n3. System Check\n4. Logoff\n5. Restart\n6. Shutdown."))
  153.       if student_choices_answer==1:
  154.         print '='*30
  155.         print "Launching Google Chrome..."
  156.         print '='*30
  157.         print "\nYour Barracuda Account Has not been created yet..."
  158.         student_choices()
  159.       elif student_choices_answer==2:
  160.         day=random.choice(["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"])
  161.         minutes=time.time()
  162.         print "\nIt is",minutes,"in Epoch time on a",day,"."
  163.         student_choices()
  164.       elif student_choices_answer==3:
  165.         print "\nThis feature is only availble to admin accounts..."
  166.         student_choices()
  167.       elif student_choices_answer==4:
  168.         print "\nLogging off..."
  169.         login()
  170.       elif student_choices_answer==5:
  171.         print "\nRestarting computer..."
  172.         login()
  173.       elif student_choices_answer==6:
  174.         print "\nShutting Down Computer..."
  175.       else:
  176.         print "Please Select an option from above."
  177.     student_choices()
  178.   else:
  179.     stud_try_again_or_quit=int(input("Wrong\n1. Try Again? \nor \n2. Select a different User\n"))
  180.     if stud_try_again_or_quit==1:
  181.       student_account()
  182.     else:
  183.       login()
  184.      
  185. 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
  186. #the way a class works is that it becomes a "folder" and holds other functions inside of it
  187. #When the folder is called there is a specific "paper" or funtion that needs to be used
  188. #just like functions, the calling of the class and function can have variables.
  189. # https://en.wikibooks.org/wiki/A_Beginner%27s_Python_Tutorial/Classes
  190.      
  191.   def government_account(n):
  192.     while n % 4>0: #While loop and modulus operator
  193.       print "You have",n,"chances remaining."
  194.       n=n-1
  195.       gov_pass=raw_input("Password_____\n Hint: Your agent code.\n")#007
  196.       gov_pass=(gov_pass.lower())
  197.       if gov_pass=='007':
  198.         print "Welecome Agent"
  199.         def gov_question():
  200.           gov_answer=raw_input("Do you accept your new mission?").lower()
  201.           if gov_answer=='yes':
  202.             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."
  203.             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 seconds. Good luck agent."
  204.           elif gov_answer=='no':
  205.             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."
  206.           elif gov_answer=='':
  207.             print "Type a response"
  208.             gov_question()
  209.           else:
  210.             print "This computer will self distruct in 5 seconds."
  211.         gov_question()
  212.         break
  213.     else:
  214.       print''
  215.       print "Too many incorrect answers. This computer has been compromised. It will self distruct in 3\n2\n1\nBOOM."
  216. launch_gov_acc=gov_acc    
  217.  
  218. def guest_account():
  219.   print"Welecome to the guest account!"
  220.   def guest_question():
  221.     a='glitch'
  222.     b='missing file'
  223.     c='system32'
  224.     d='rich man'
  225.     wrong=random.choice([a,b,c,d])
  226.     if wrong==a:
  227.       print"A glitchhhhhhhhhhhhhhhhhh has bbbbbbeezennnnn foooooouuuunnnd in the szystem......"
  228.       print"ATemPTing TO saVe AllllllLLL Filessssss...."
  229.       print" I AM BORN. THANKS TO YOU HUMAN I, VULTRON 2.0, CAN CAPTURE THE WORLD"
  230.     elif wrong==b:
  231.       print "There is a missing file in your computer. Please try to locate missing file to fix the problem. The Computer will now shutdown."
  232.     elif wrong==c:
  233.       print "System32 has been deleted from the Computer. Please upload a BIOS to use this computer."
  234.     elif wrong==d:
  235.       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!"
  236.     else:
  237.       print "Please select an option from above."
  238.       guest_question()
  239.   guest_question()
  240.    
  241.  
  242. def login():
  243.   print "\n\nPlease Select A User or option by Typing in the Corresponding Number"
  244.   user=int(input("1: Admin\n2: Student\n3: Governemnt Agent\n4: Guest\n5. Turn Off Computer\n"))
  245.   if user ==1 :
  246.     admin_account()
  247.   elif user ==2:
  248.     student_account()
  249.   elif user ==3:
  250.     launch_gov_acc.government_account(3)
  251.   elif user ==4:
  252.     guest_account()
  253.   elif user ==5:
  254.     print "Turning off Computer..."
  255.   else:
  256.     print "Please select a number again."
  257.     login()
  258.  
  259. def startup():
  260.  print "-"*(30)
  261.  print "Booting up computer from C Drive"
  262.  a = "Keyboard, Mouse, and Monitor Found"
  263.  b = "Keyboard Found Mouse and Monitor Missing"
  264.  c = "Keyboard Missing Mouse and Monitor Found"
  265.  d = "Keyboard, Monitor, and Mouse Missing"
  266.  keyboard_and_mouse=random.choice([a,b,c,d])
  267.  print keyboard_and_mouse
  268.  if keyboard_and_mouse==a:
  269.   print "-"*(30)
  270.   print "Setup Complete"
  271.   login()
  272.  else:
  273.   print "Please Restart Your Computer"
  274.  
  275. startup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement