Advertisement
GameNationRDF

Python Control Center & Launcher beta 1.5

Sep 22nd, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.25 KB | None | 0 0
  1. #Python Control Center version "Beta 1.5"
  2. #Coded by GameNationRDF
  3. #It will be updated frequently with bug fixes and new feautures!
  4.  
  5. #Download link: https://www.dropbox.com/s/7rsrt2dec44po69/Control%20Center%20%26%20Launcher%20beta%201.5.py
  6.  
  7. import webbrowser
  8. import sys
  9. import os
  10. import string
  11. import time
  12. import urllib.request
  13. from math import sqrt
  14. currentVersion = ("Beta 1.5")
  15. developer = ("Umut Bilgic")
  16. year = ("2013")
  17.  
  18. def halfBlankScreenShort():
  19.     for i in range(10):
  20.         print("")
  21.  
  22. def halfBlankScreenLong():
  23.     for i in range(24):
  24.         print("")
  25.  
  26. def blank():
  27.     print ("")
  28.  
  29. def helpF():
  30.    
  31.     st1=("Here are the things you can do: ")
  32.     st2=("    * Type the website and hit enter to launch that website!")
  33.     st3=("    * Type 'source' and then the URL to view the sourcecode of that website!")
  34.     st4=("    * Type 'file', and write the location of a file/program to launch it!")
  35.     st5=("    * Type 'c' to qucikly launch a file browser under 'file' menu!")
  36.     st6=("    * Type 'p' to quickly launch a python shell under 'file' menu!)")
  37.     st6=("    * Type 'math' to do basic math operations!")
  38.     st7=("    * Type 'time' to set up a timer!")
  39.     st8=("    * Type 'ping' to open up the ping menu and ping websites!")
  40.     st9=("    * Type 'info' to get info about the program.")
  41.     st10=("    * Type 'exit' to close the program.")
  42.     introStringList=[st1, st2, st3, st4, st5, st6, st7, st8, st9, st10]
  43.     for i in (introStringList):
  44.         print (i)
  45.         blank()
  46.  
  47. halfBlankScreenShort()
  48. print ("                             |--------------------|")
  49. print ("                             |  LOADING LAUNCHER  |")
  50. print ("                             |--------------------|")
  51. time.sleep(0.5)
  52. halfBlankScreenLong()
  53.  
  54. print ("Type 'help' to see what you can do!")
  55. blank()
  56.  
  57. # --- MAIN LOOP --- #
  58.  
  59. while True:
  60.     userIn=str(input("Enter address/command here: "))
  61.     blank()
  62.  
  63.     if userIn == ("help"):
  64.         helpF()
  65.        
  66.     elif userIn == ("exit"):
  67.         print ("Program will close in a moment..")
  68.         time.sleep(0.7)
  69.         sys.exit()
  70.        
  71.     elif userIn == ("file"):
  72.         filename=str(input("    * Enter file place: "))
  73.         blank()
  74.         if filename == ("c"):
  75.             c=("C:\ ")
  76.             os.system("start " + c)
  77.         if filename == ("p"):
  78.             os.system("start "+"C:\python33\python")
  79.         else:
  80.             os.system("start "+filename)
  81.            
  82.     elif userIn.startswith("www") is True:
  83.         webbrowser.open(userIn)
  84.  
  85.     elif userIn == ("source"):
  86.         userURL=str(input("    * Enter the URL Address: "))
  87.         print (urllib.request.urlopen(userURL).read())
  88.         blank()
  89.        
  90.     elif userIn == ("math"):
  91.         op = str(input("    * Enter operation (+, -, *, /, exp, sqrt): "))
  92.         blank()
  93.         if op==("+") or op==("-") or op==("*") or op==("/") or op==("exp"):
  94.             input_1 = int(input("       * Enter first number:  "))
  95.             blank()
  96.             input_2 = int(input("       * Enter second number: "))
  97.             blank()
  98.         if op == ("+"):
  99.             print ("       > "+str(input_1 + input_2))
  100.             blank()
  101.         elif op == ("-"):
  102.             print ("       > "+str(input_1-input_2))
  103.             blank()
  104.         elif op == ("*"):
  105.             print ("       > "+str(input_1*input_2))
  106.             blank()
  107.         elif op == ("/"):
  108.             print ("       > "+str(input_1/input_2))
  109.             blank()
  110.         elif op == ("exp"):
  111.             print ("       > "+str(input_1**input_2))
  112.             blank()
  113.         elif op == ("sqrt"):
  114.             oneInput=int(input("        * Enter number: "))
  115.             blank()
  116.             print ("       > "+str(sqrt(oneInput)))
  117.             blank()
  118.  
  119.     elif userIn == ("ping"):
  120.         userWebsite=str(input("    * Enter the website: "))
  121.         os.system("ping "+(userWebsite))
  122.         blank()
  123.  
  124.     elif userIn == ("info"):
  125.         print (" - Current Version: "+currentVersion)
  126.         print (" - Developer: "+developer)
  127.         print (" - "+year)
  128.         blank()
  129.        
  130.     elif userIn == ("time"):
  131.         userTimeMode = str(input("  * Minutes or Seconds? (m/s): "))
  132.         blank()
  133.         if userTimeMode == ("m"):
  134.             userLimitMin = int(input("  * Set your timer (minutes): "))
  135.             blank()
  136.             userLimit = (userLimitMin * 60)
  137.         else:
  138.             userLimit = int(input("    * Set your timer (seconds): "))
  139.             blank()
  140.         userMode  = str(input("    * Display mode? (y/n): "))
  141.         blank()
  142.         for i in range(1, userLimit):
  143.             if userMode == ("y") or userMode == ("Y"):
  144.                 print (i)
  145.             time.sleep(1.0)
  146.         blank()
  147.         print ("|---------------------|")
  148.         print ("| Countdown finished! |")
  149.         print ("|---------------------|")
  150.         blank()
  151.  
  152.     elif ((userIn.endswith(".com") is True) or (userIn.endswith(".org") is True) or ((userIn.endswith(".net") is True)))  and userIn.startswith("www") is False:
  153.         userIn = ("www."+userIn)
  154.         webbrowser.open(userIn)
  155.         blank()
  156.        
  157.     else:
  158.         print ("Sorry, unknown command!")
  159.         blank()
  160.  
  161. #Changelog:
  162.         # -A quick shortcut to python shell added. (file/p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement