Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Python Control Center version "Beta 1.8"
- #Coded by Umut Bilgic (GameNationRDF)
- #It will be updated frequently with bug fixes and new feautures!
- #Download link: https://www.dropbox.com/s/h0asj73c1kkfwyw/Control%20Center%20%26%20Launcher%20beta%201.8.py
- import webbrowser
- import sys
- import os
- import time
- import urllib.request
- import math
- currentVersion = ("Beta 1.8")
- developer = ("Umut Bilgic")
- year = ("2013")
- def spanLister(LIST):
- for i in (LIST):
- print (i)
- blank()
- def viewChangeLog():
- cl0=("In this version ("+currentVersion+") :")
- cl1=(" * Added Google Search.")
- changeLogList=[cl0,cl1]
- spanLister(changeLogList)
- def halfBlankScreenShort():
- for i in range(10):
- print("")
- def halfBlankScreenLong():
- for i in range(24):
- print("")
- def blank():
- print ("")
- def helpF1():
- st1_1= ("Here are the things you can do (Viewing page 1): ")
- st1_2= (" * Type the website and hit enter to launch that website!")
- st1_3= (" * Type 'source' and then the URL to view the sourcecode of that website!")
- st1_4= (" * Type 'file', and write the location of a file/program to launch it!")
- st1_5= (" * Type 'c' to qucikly launch a file browser under 'file' menu!")
- st1_6= (" * Type 'p' to quickly launch a python shell under 'file' menu!)")
- st1_7= (" * Type 'math' to do basic math operations!")
- st1_8= (" * Type 'time' to set up a timer!")
- st1_9= (" * Type 'change' to view the changelog!")
- st1_10=(" * Type 'ping' to open up the ping menu and ping websites!")
- st1_11=(" * Type 'info' to get info about the program.")
- st1_12=(" * Type 'os.' and command after dot to perform default OS commands!")
- helpStringList1=[st1_1,st1_2,st1_3,st1_4,st1_5,st1_6,st1_7,st1_8,st1_9,st1_10,st1_11,st1_12]
- spanLister(helpStringList1)
- def helpF2():
- st2_1= ("Here are the things you can do (Viewing page 2): ")
- st2_2= (" * Type 'search.' and the item after dot to search it with Google search!")
- st2_3= (" * Type 'dev' to launch developer webpage.")
- st2_4= (" * Type 'clear' to clear the program screen!")
- st2_4=("Type 'exit' to close program.")
- helpStringList2=[st2_1,st2_2,st2_3,st2_4]
- spanLister(helpStringList2)
- halfBlankScreenShort()
- print (" /--------------------\ ")
- print (" | LOADING LAUNCHER | ")
- print (" \--------------------/ ")
- time.sleep(0.5)
- halfBlankScreenLong()
- print (" * Type 'help-1' or 'help-2' to see what you can do! * ")
- blank()
- # --- MAIN LOOP --- #
- while True:
- userIn=str(input("Enter address/command here: "))
- blank()
- if userIn == ("help-1"):
- helpF1()
- elif userIn == ("help-2"):
- helpF2()
- elif userIn == ("exit"):
- print ("Program will close in a moment..")
- time.sleep(0.7)
- sys.exit()
- elif userIn.startswith("search.") is True:
- searchList=userIn.split(".")
- searchItem=searchList[1]
- webbrowser.open("www.google.com/search?q="+searchItem)
- blank()
- elif userIn.startswith("os.")is True:
- cmdList=userIn.split(".")
- os.system(cmdList[1])
- blank()
- elif userIn == ("file"):
- filename=str(input(" * Enter file place: "))
- blank()
- if filename == ("c"):
- c=("C:\ ")
- os.system("start " + c)
- if filename == ("p"):
- os.system("start "+"C:\python33\python")
- else:
- os.system("start "+filename)
- elif userIn == ("dev"):
- webbrowser.open("www.pastebin.com/u/GameNationRDF/")
- elif userIn.startswith("www.") is True:
- webbrowser.open(userIn)
- elif userIn == ("source"):
- userURL=str(input(" * Enter the URL Address: "))
- print (urllib.request.urlopen(userURL).read())
- blank()
- elif userIn == ("math"):
- op = str(input(" * Enter operation (+, -, *, /, exp, sqrt, log): "))
- blank()
- if op==("+") or op==("-") or op==("*") or op==("/") or op==("exp"):
- input_1 = int(input(" * Enter first number: "))
- blank()
- input_2 = int(input(" * Enter second number: "))
- blank()
- if op == ("+"):
- print (" > "+str(input_1 + input_2))
- blank()
- elif op == ("-"):
- print (" > "+str(input_1-input_2))
- blank()
- elif op == ("*"):
- print (" > "+str(input_1*input_2))
- blank()
- elif op == ("/"):
- print (" > "+str(input_1/input_2))
- blank()
- elif op == ("exp"):
- print (" > "+str(input_1**input_2))
- blank()
- elif op == ("sqrt"):
- oneInput=int(input(" * Enter number: "))
- blank()
- print (" > "+str(math.sqrt(oneInput)))
- blank()
- elif op == ("log"):
- input_1 = int(input(" * Enter number: "))
- blank()
- input_2 = int(input(" * Enter base: "))
- blank()
- print (" > "+str(int((math.log(input_1, input_2)))))
- blank()
- elif userIn == ("ping"):
- userWebsite=str(input(" * Enter the website: "))
- os.system("ping "+(userWebsite))
- blank()
- elif userIn == ("info"):
- print (" - Current Version: "+currentVersion)
- print (" - Developer: "+developer)
- print (" - "+year)
- blank()
- elif userIn == ("time"):
- userTimeMode = str(input(" * Minutes or Seconds? (m/s): "))
- blank()
- if userTimeMode == ("m"):
- userLimitMin = int(input(" * Set your timer (minutes): "))
- blank()
- userLimit = (userLimitMin * 60)
- else:
- userLimit = int(input(" * Set your timer (seconds): "))
- blank()
- userMode = str(input(" * Display mode? (y/n): "))
- blank()
- for i in range(1, userLimit):
- if userMode == ("y") or userMode == ("Y"):
- print (i)
- time.sleep(1.0)
- blank()
- print ("/---------------------\ ")
- print ("| Countdown finished! | ")
- print ("\---------------------/ ")
- blank()
- elif userIn==("change"):
- viewChangeLog()
- elif ((userIn.endswith(".com") is True) or (userIn.endswith(".org") is True) or ((userIn.endswith(".net") is True))) and userIn.startswith("www") is False:
- userIn = ("www."+userIn)
- webbrowser.open(userIn)
- blank()
- elif userIn==("clear"):
- halfBlankScreenShort()
- os.system("cls")
- else:
- print (" - Sorry, unknown command! -")
- blank()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement