Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Python Control Center version "Beta 1.5"
- #Coded by GameNationRDF
- #It will be updated frequently with bug fixes and new feautures!
- #Download link: https://www.dropbox.com/s/7rsrt2dec44po69/Control%20Center%20%26%20Launcher%20beta%201.5.py
- import webbrowser
- import sys
- import os
- import string
- import time
- import urllib.request
- from math import sqrt
- currentVersion = ("Beta 1.5")
- developer = ("Umut Bilgic")
- year = ("2013")
- def halfBlankScreenShort():
- for i in range(10):
- print("")
- def halfBlankScreenLong():
- for i in range(24):
- print("")
- def blank():
- print ("")
- def helpF():
- st1=("Here are the things you can do: ")
- st2=(" * Type the website and hit enter to launch that website!")
- st3=(" * Type 'source' and then the URL to view the sourcecode of that website!")
- st4=(" * Type 'file', and write the location of a file/program to launch it!")
- st5=(" * Type 'c' to qucikly launch a file browser under 'file' menu!")
- st6=(" * Type 'p' to quickly launch a python shell under 'file' menu!)")
- st6=(" * Type 'math' to do basic math operations!")
- st7=(" * Type 'time' to set up a timer!")
- st8=(" * Type 'ping' to open up the ping menu and ping websites!")
- st9=(" * Type 'info' to get info about the program.")
- st10=(" * Type 'exit' to close the program.")
- introStringList=[st1, st2, st3, st4, st5, st6, st7, st8, st9, st10]
- for i in (introStringList):
- print (i)
- blank()
- halfBlankScreenShort()
- print (" |--------------------|")
- print (" | LOADING LAUNCHER |")
- print (" |--------------------|")
- time.sleep(0.5)
- halfBlankScreenLong()
- print ("Type 'help' to see what you can do!")
- blank()
- # --- MAIN LOOP --- #
- while True:
- userIn=str(input("Enter address/command here: "))
- blank()
- if userIn == ("help"):
- helpF()
- elif userIn == ("exit"):
- print ("Program will close in a moment..")
- time.sleep(0.7)
- sys.exit()
- 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.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): "))
- 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(sqrt(oneInput)))
- 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.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()
- else:
- print ("Sorry, unknown command!")
- blank()
- #Changelog:
- # -A quick shortcut to python shell added. (file/p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement