Advertisement
Felanpro

terminal

Aug 15th, 2016
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.64 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. from tkinter import *
  70.  
  71. source_code = """
  72.        <html>
  73.  
  74.        <head>
  75.  
  76.        <title>Website</title>
  77.  
  78.        <style>
  79.  
  80.        #demo {
  81.  
  82.        color: orange;
  83.        font-family: helvetica;
  84.        
  85.        }
  86.        
  87.        </style>
  88.        
  89.        </head>
  90.  
  91.        <body>
  92.  
  93.        <p id="demo">Made by python</p>
  94.        
  95.        </body>
  96.        
  97.        </html>
  98.        """
  99.  
  100. current_time = datetime.datetime.now()
  101.  
  102. while flag is True:
  103.     user_input = input(">")
  104.  
  105.     if user_input == "time":
  106.         print("Current date and time:", current_time)
  107.     else:
  108.         pass
  109.  
  110.     if user_input == "mkdir":
  111.         os.mkdir("directory from terminal")
  112.         print('A directory named "directory from terminal" has been created on your computer.')
  113.     else:
  114.         pass
  115.  
  116.     if user_input == "whoami":
  117.         print(os.getlogin())
  118.     else:
  119.         pass
  120.  
  121.     if user_input == "os":
  122.         print(platform.system())
  123.     else:
  124.         pass
  125.  
  126.     if user_input == "get area of square":
  127.         area_width = int(input("Width: "))
  128.         area_height = int(input("Height: "))
  129.         sum_of_area = area_width * area_height
  130.         print(sum_of_area)
  131.     else:
  132.         pass
  133.  
  134.     if user_input == "get power of":
  135.         num1 = float(input("Base: "))
  136.         num2 = float(input("Exponent: "))
  137.         sum1 = num1**num2
  138.         print(sum1)
  139.     else:
  140.         pass
  141.  
  142.     if user_input == "random":
  143.         rand_num = random.randint(1, 1000 + 1)
  144.         print(rand_num)
  145.     else:
  146.         pass
  147.  
  148.     if user_input == "exec":
  149.         exec_string = input("Put python code (one line): ")
  150.         exec(exec_string)
  151.     else:
  152.         pass
  153.  
  154.     if user_input == "say":
  155.         say_command = input("say: ")
  156.         print(say_command)
  157.     else:
  158.         pass
  159.  
  160.     if user_input == "html":
  161.         html_file = open("python_html", 'w')
  162.         html_file.write(source_code)
  163.         html_file.close()
  164.     else:
  165.         pass
  166.  
  167.     if user_input == "get html source code":
  168.         html_file = open("python_html", 'r')
  169.         print(html_file.read())
  170.         html_file.close()
  171.    
  172.     if user_input == "help":
  173.         print("List of all commands.")
  174.         print("**********")
  175.         print("time")
  176.         print("mkdir")
  177.         print("whoami")
  178.         print("os")
  179.         print("get area of square")
  180.         print("get power of")
  181.         print("random")
  182.         print("exec")
  183.         print("say")
  184.         print("html")
  185.         print("get html source code")
  186.         print("**********")
  187.     else:
  188.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement