Advertisement
Felanpro

terminal upgrade

Aug 15th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.10 KB | None | 0 0
  1. from time import sleep
  2. import winsound
  3.  
  4. '''---Intro---'''
  5. winsound.Beep(2000, 500)
  6. winsound.Beep(2000, 500)
  7. winsound.Beep(2000, 500)
  8. print("*", end="")
  9. sleep(0.070)
  10. print("*", end="")
  11. sleep(0.070)
  12. print("*", end="")
  13. sleep(0.070)
  14. print("*", end="")
  15. sleep(0.070)
  16. print("*", end="")
  17. sleep(0.070)
  18. print("*", end="")
  19. sleep(0.070)
  20. print("*", end="")
  21. sleep(0.070)
  22. print("*", end="")
  23. sleep(0.070)
  24. print("*", end="")
  25. sleep(0.070)
  26. print("*", end="")
  27. sleep(0.070)
  28. print("*", end="")
  29. sleep(0.070)
  30. print("*", end="")
  31. sleep(0.070)
  32. print("*")
  33. sleep(0.6)
  34. print("T", end="")
  35. sleep(0.070)
  36. print("e", end="")
  37. sleep(0.070)
  38. print("r", end="")
  39. sleep(0.070)
  40. print("m", end="")
  41. sleep(0.070)
  42. print("i", end="")
  43. sleep(0.070)
  44. print("n", end="")
  45. sleep(0.070)
  46. print("a", end="")
  47. sleep(0.070)
  48. print("l", end="")
  49. sleep(0.070)
  50. print(end=" ")
  51. sleep(0.070)
  52. print("B", end="")
  53. sleep(0.070)
  54. print("o", end="")
  55. sleep(0.070)
  56. print("o", end="")
  57. sleep(0.070)
  58. print("t")
  59. sleep(0.070)
  60. winsound.Beep(2000, 500)
  61. '''---Intro End---'''
  62.  
  63. flag = True
  64.  
  65. import datetime
  66. import os
  67. import platform
  68. import random
  69. import math
  70. from tkinter import *
  71. import tkinter.messagebox
  72.  
  73. source_code = """
  74.       <html>
  75.  
  76.       <head>
  77.  
  78.       <title>Website</title>
  79.  
  80.       <style>
  81.  
  82.       #demo {
  83.  
  84.       color: orange;
  85.       font-family: helvetica;
  86.      
  87.       }
  88.      
  89.       </style>
  90.      
  91.       </head>
  92.  
  93.       <body>
  94.  
  95.       <p id="demo">Made by python</p>
  96.      
  97.       </body>
  98.      
  99.       </html>
  100.       """
  101.  
  102. current_time = datetime.datetime.now()
  103.  
  104. while flag is True:
  105.     user_input = input(">")
  106.  
  107.     if user_input == "time":
  108.         print("Current date and time:", current_time)
  109.     else:
  110.         pass
  111.  
  112.     if user_input == "mkdir":
  113.         os.mkdir("directory from terminal")
  114.         print('A directory named "directory from terminal" has been created on your computer.')
  115.     else:
  116.         pass
  117.  
  118.     if user_input == "whoami":
  119.         print(os.getlogin())
  120.     else:
  121.         pass
  122.  
  123.     if user_input == "os":
  124.         system1 = platform.system()
  125.         print(platform.system())
  126.     else:
  127.         pass
  128.  
  129.     if system1 == "Windows":
  130.         tkinter.message
  131.    
  132.     if user_input == "get area of square":
  133.         area_width = int(input("Width: "))
  134.         area_height = int(input("Height: "))
  135.         sum_of_area = area_width * area_height
  136.         print(sum_of_area)
  137.     else:
  138.         pass
  139.  
  140.     if user_input == "get power of":
  141.         num1 = float(input("Base: "))
  142.         num2 = float(input("Exponent: "))
  143.         sum1 = num1**num2
  144.         print(sum1)
  145.     else:
  146.         pass
  147.  
  148.     if user_input == "random":
  149.         rand_num = random.randint(1, 1000 + 1)
  150.         print(rand_num)
  151.     else:
  152.         pass
  153.  
  154.     if user_input == "exec":
  155.         exec_string = input("Put python code (one line): ")
  156.         exec(exec_string)
  157.     else:
  158.         pass
  159.  
  160.     if user_input == "say":
  161.         say_command = input("say: ")
  162.         print(say_command)
  163.     else:
  164.         pass
  165.  
  166.     if user_input == "html":
  167.         html_file = open("python_html", 'w')
  168.         html_file.write(source_code)
  169.         html_file.close()
  170.     else:
  171.         pass
  172.  
  173.     if user_input == "get html source code":
  174.         html_file = open("python_html", 'r')
  175.         print(html_file.read())
  176.         html_file.close()
  177.     else:
  178.         pass
  179.  
  180.     if user_input == "current directory":
  181.         print(os.getcwd())
  182.     else:
  183.         pass
  184.  
  185.     if user_input == "sqrt":
  186.         sqrt_input = float(input("Get square root of: "))
  187.         print(math.sqrt(sqrt_input))
  188.     else:
  189.         pass
  190.    
  191.     if user_input == "help":
  192.         print("List of all commands.")
  193.         print("**********")
  194.         print("time")
  195.         print("mkdir")
  196.         print("whoami")
  197.         print("os")
  198.         print("get area of square")
  199.         print("get power of")
  200.         print("random")
  201.         print("exec")
  202.         print("say")
  203.         print("html")
  204.         print("get html source code")
  205.         print("current directory")
  206.         print("sqrt")
  207.         print("**********")
  208.     else:
  209.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement