Advertisement
GameNationRDF

Python Control Center & Launcher beta 1.1

Sep 20th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.09 KB | None | 0 0
  1. #Python Control Center version "Beta 1.1"
  2. #Coded by GameNationRDF
  3. #It will be updated frequently with bug fixes and new feautures!
  4. import webbrowser
  5. import sys
  6. import os
  7. import string
  8. import time
  9. import math
  10.  
  11. currentVersion = ("Beta 1.1")
  12. developer = ("Umut Bilgic")
  13. year = ("2013")
  14.  
  15. def halfBlankScreen():
  16.     for i in range(12):
  17.         print("")
  18.  
  19. def blank():
  20.     print ("")
  21.  
  22. halfBlankScreen()
  23. print ("                             |--------------------|")
  24. print ("                             |  LOADING LAUNCHER  |")
  25. print ("                             |--------------------|")
  26. halfBlankScreen()
  27. time.sleep(0.5)
  28.  
  29. st1=("Here are the things you can do: ")
  30. st2=("    * Type the website and hit enter to launch that website!")
  31. st3=("    * Type 'file', and write the location of a file/program to launch it!")
  32. st4=("    * Type 'c' to qucikly launch a file browser under 'file' menu!")
  33. st5=("    * Type 'math' to do basic math operations!")
  34. st6=("    * Type 'time' to set up a timer!")
  35. st7=("    * Type 'ping' to open up the ping menu and ping websites!")
  36. st8=("    * Type 'info' to get info about the program.")
  37. st9=("    * Type 'exit' to close the program!")
  38. introStringList=[st1, st2, st3, st4, st5, st6, st7, st8, st9]
  39. for i in (introStringList):
  40.     print (i)
  41.     blank()
  42.    
  43. while True:
  44.     userIn=str(input("Enter address/command here: "))
  45.     blank()
  46.     if userIn == ("exit"):
  47.         print ("Program will close in a second..")
  48.         time.sleep(1)
  49.         sys.exit()
  50.     elif userIn == ("file"):
  51.         filename=str(input("    * Enter file place: "))
  52.         blank()
  53.         if filename == ("c"):
  54.             c=("C:\ ")
  55.             os.system("start " + c)
  56.         else:
  57.             os.system("start "+filename)
  58.     elif userIn.startswith("www") is True:
  59.         handle=webbrowser.get()
  60.         handle.open(userIn)
  61.     elif userIn == ("math"):
  62.         op = str(input("Enter operation (+, -, *, /, exp, sqrt): "))
  63.         blank()
  64.         if op==("+") or op==("-") or op==("*") or op==("/") or op==("exp"):
  65.             input_1 = int(input("   * Enter first number:  "))
  66.             input_2 = int(input("   * Enter second number: "))
  67.         if op == ("+"):
  68.             print (input_1 + input_2)
  69.             blank()
  70.         elif op == ("-"):
  71.             print (input_1-input_2)
  72.             blank()
  73.         elif op == ("*"):
  74.             print (input_1*input_2)
  75.             blank()
  76.         elif op == ("/"):
  77.             print (input_1/input_2)
  78.             blank()
  79.         elif op == ("exp"):
  80.             print (input_1**input_2)
  81.             blank()
  82.         elif op == ("sqrt"):
  83.             oneInput=int(input("    * Enter number: "))
  84.             print (int((math.sqrt(oneInput))))
  85.             blank()
  86.  
  87.     elif userIn == ("ping"):
  88.         userWebsite=str(input("    * Enter the website: "))
  89.         os.system("ping "+(userWebsite))
  90.         blank()
  91.  
  92.     elif userIn == ("info"):
  93.         print (" - Current Version: "+currentVersion)
  94.         print (" - Developer: "+developer)
  95.         print (" - "+year)
  96.     elif userIn == ("time"):
  97.         userTimeMode = str(input("  * Minutes or Seconds? (m/s): "))
  98.         blank()
  99.         if userTimeMode == ("m"):
  100.             userLimitMin = int(input("  * Set your timer (minutes): "))
  101.             blank()
  102.             userLimit = (userLimitMin * 60)
  103.         else:
  104.             userLimit = int(input("    * Set your timer (seconds): "))
  105.             blank()
  106.         userMode  = str(input("    * Display mode? (y/n): "))
  107.         blank()
  108.         for i in range(1, userLimit):
  109.             if userMode == ("y") or userMode == ("Y"):
  110.                 print (i)
  111.             time.sleep(1.0)
  112.         blank()
  113.         print ("|---------------------|")
  114.         print ("| Countdown finished! |")
  115.         print ("|---------------------|")
  116.         blank()
  117.        
  118.     else:
  119.         print ("Sorry, unknown command!")
  120.         blank()
  121.  
  122.  
  123. #Changelog:
  124.         # -Cleaner code.
  125.         # -Quick File Browser launcher added.
  126.         # -Ping websites with the new added ping menu.
  127.         # -Loading screen added.
  128.         # -Some fancy ASCII sutff :D.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement