Advertisement
GameNationRDF

Python Website & File Launcher! version 0.0.6 (Cmd. Update)

Sep 15th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. #Python Launcher version 0.0.6
  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. print ("Here are the things you can do: ")
  9. print ("")
  10. print ("    *Type the website and hit enter to launch that website!")
  11. print ("")
  12. print ("    *Type 'file', and write the location of a file/program to launch it!")
  13. print ("")
  14. print ("    *Type 'exit' to close the program!")
  15. print ("")
  16. while True:
  17.     userIn=str(input("Enter address/command here: "))
  18.     print ("")
  19.     if userIn == ("exit"):
  20.         sys.exit()
  21.     elif userIn == ("file"):
  22.         filename=str(input("    *Enter file place: "))
  23.         os.system("start "+filename)
  24.     elif userIn.startswith("www") is True:
  25.         handle=webbrowser.get()
  26.         handle.open(userIn)
  27.     else:
  28.         print ("Sorry, unknown command!")
  29.  
  30.  
  31. #Changelog:
  32.         # -Website entry detection added.
  33.         # -Unknown command handling added.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement