Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Python Launcher version 0.0.8
- #Coded by GameNationRDF
- #It will be updated frequently with bug fixes and new feautures!
- import webbrowser
- import sys
- import os
- import string
- import time
- import math
- def blank():
- print (" ")
- def intro():
- print ("Here are the things you can do: ")
- blank()
- print (" *Type the website and hit enter to launch that website!")
- blank()
- print (" *Type 'file', and write the location of a file/program to launch it!")
- blank()
- print (" *Type 'exit' to close the program!")
- blank()
- print (" *Type 'math' to do basic math operations!")
- blank()
- intro()
- while True:
- userIn=str(input("Enter address/command here: "))
- blank()
- if userIn == ("exit"):
- print ("Program will close in a second..")
- time.sleep(1)
- sys.exit()
- elif userIn == ("file"):
- filename=str(input(" *Enter file place: "))
- os.system("start "+filename)
- elif userIn.startswith("www") is True:
- handle=webbrowser.get()
- handle.open(userIn)
- elif userIn == ("math"):
- operation = str(input("Enter operation (+, -, *, /, sqrt, exp): "))
- blank()
- if operation == ("+"):
- input_1 = int(input(" *Enter first number: "))
- input_2 = int(input(" *Enter second number: "))
- print ((input_1)+(input_2))
- blank()
- elif operation == ("-"):
- input_1 = int(input(" *Enter first number: "))
- input_2 = int(input(" *Enter second number: "))
- print ((input_1)-(input_2))
- blank()
- elif operation == ("*"):
- input_1 = int(input(" *Enter first number: "))
- input_2 = int(input(" *Enter second number: "))
- print ((input_1)*(input_2))
- blank()
- elif operation == ("/"):
- input_1 = int(input(" *Enter first number: "))
- input_2 = int(input(" *Enter second number: "))
- print ((input_1)/(input_2))
- blank()
- elif operation == ("exp"):
- input_1 = int(input(" *Enter first number: "))
- input_2 = int(input(" *Enter second number: "))
- print ((input_1)**(input_2))
- blank()
- elif operation == ("sqrt"):
- oneInput = int(input(" *Enter number: "))
- print (math.sqrt(oneInput))
- blank()
- else:
- print ("Sorry, unknown command!")
- blank()
- #Changelog:
- # -Very quick update: Exponents added!
- #Other changes from 0.0.7:
- # -Math operators added :) .
- # -Overhauled code! (made everything better :D)
- # -Again, better UI.
- # -More operations and file shortcuts coming soon!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement