Advertisement
GameNationRDF

Python Control Center & Launcher version 0.1.0 beta

Sep 15th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.81 KB | None | 0 0
  1. #Python Control Center version 0.1.0 beta
  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 = ("0.1.0 beta")
  12. developer = ("Umut Bilgic")
  13. year = ("2013")
  14.  
  15. def blank():
  16.     print (" ")
  17.  
  18. def intro():
  19.     print ("Here are the things you can do: ")
  20.     blank()
  21.     print ("    *Type the website and hit enter to launch that website!")
  22.     blank()
  23.     print ("    *Type 'file', and write the location of a file/program to launch it!")
  24.     blank()
  25.     print ("    *Type 'math' to do basic math operations!")
  26.     blank()
  27.     print ("    *Type 'time' to set up a timer!")
  28.     blank()
  29.     print ("    *Type 'info' to get info about the program.")
  30.     blank()
  31.     print ("    *Type 'exit' to close the program!")
  32.     blank()
  33.  
  34.  
  35. intro()
  36.    
  37. while True:
  38.     userIn=str(input("Enter address/command here: "))
  39.     blank()
  40.     if userIn == ("exit"):
  41.         print ("Program will close in a second..")
  42.         time.sleep(1)
  43.         sys.exit()
  44.     elif userIn == ("file"):
  45.         filename=str(input("    *Enter file place: "))
  46.         os.system("start "+filename)
  47.     elif userIn.startswith("www") is True:
  48.         handle=webbrowser.get()
  49.         handle.open(userIn)
  50.     elif userIn == ("math"):
  51.  
  52.         operation = str(input("Enter operation (+, -, *, /, sqrt, exp): "))
  53.         blank()
  54.        
  55.         if operation == ("+"):
  56.             input_1 = int(input("   *Enter first number:  "))
  57.             input_2 = int(input("   *Enter second number: "))
  58.             print ((input_1)+(input_2))
  59.             blank()
  60.         elif operation == ("-"):
  61.             input_1 = int(input("   *Enter first number:  "))
  62.             input_2 = int(input("   *Enter second number: "))
  63.             print ((input_1)-(input_2))
  64.             blank()
  65.         elif operation == ("*"):
  66.             input_1 = int(input("   *Enter first number:  "))
  67.             input_2 = int(input("   *Enter second number: "))
  68.             print ((input_1)*(input_2))
  69.             blank()
  70.         elif operation == ("/"):
  71.             input_1 = int(input("   *Enter first number:  "))
  72.             input_2 = int(input("   *Enter second number: "))
  73.             print ((input_1)/(input_2))
  74.             blank()
  75.         elif operation == ("exp"):
  76.             input_1 = int(input("   *Enter first number:  "))
  77.             input_2 = int(input("   *Enter second number: "))
  78.             print ((input_1)**(input_2))
  79.             blank()
  80.         elif operation == ("sqrt"):
  81.             oneInput = int(input("  *Enter number: "))
  82.             print (math.sqrt(oneInput))
  83.             blank()
  84.  
  85.     elif userIn == ("info"):
  86.         print (" - Current Version: "+currentVersion)
  87.         print (" - Developer: "+developer)
  88.         print (" - "+year)
  89.     elif userIn == ("time"):
  90.         userTimeMode = str(input("  *Minutes or Seconds? (m/s): "))
  91.         blank()
  92.         if userTimeMode == ("m"):
  93.             userLimitMin = int(input("  *Set your timer (minutes): "))
  94.             blank()
  95.             userLimit = (userLimitMin * 60)
  96.         else:
  97.             userLimit = int(input("    *Set your timer (seconds): "))
  98.             blank()
  99.         userMode  = str(input("    *Display mode? (y/n): "))
  100.         blank()
  101.         for i in range(1, userLimit):
  102.             if userMode == ("y") or userMode == ("Y"):
  103.                 print (i)
  104.             time.sleep(1.0)
  105.         print ("Countdown finished!")
  106.         blank()
  107.        
  108.     else:
  109.         print ("Sorry, unknown command!")
  110.         blank()
  111.  
  112.  
  113. #Changelog:
  114.         # -Beta is here!
  115.         # -Timer mode added! Set a timer in minutes or seconds!
  116.         # -Info added.
  117.         # -Derpy herps fixed. (Exponent function was not working properly)
  118.         # -Program name is more accurate :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement