Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import sleep
- import winsound
- '''---Intro---'''
- winsound.Beep(2000, 500)
- winsound.Beep(2000, 500)
- winsound.Beep(2000, 500)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*", end="")
- sleep(0.070)
- print("*")
- sleep(0.6)
- print("T", end="")
- sleep(0.070)
- print("e", end="")
- sleep(0.070)
- print("r", end="")
- sleep(0.070)
- print("m", end="")
- sleep(0.070)
- print("i", end="")
- sleep(0.070)
- print("n", end="")
- sleep(0.070)
- print("a", end="")
- sleep(0.070)
- print("l", end="")
- sleep(0.070)
- print(end=" ")
- sleep(0.070)
- print("B", end="")
- sleep(0.070)
- print("o", end="")
- sleep(0.070)
- print("o", end="")
- sleep(0.070)
- print("t")
- sleep(0.070)
- winsound.Beep(2000, 500)
- '''---Intro End---'''
- flag = True
- import datetime
- import os
- import platform
- import random
- import math
- from tkinter import *
- import tkinter.messagebox
- source_code = """
- <html>
- <head>
- <title>Website</title>
- <style>
- #demo {
- color: orange;
- font-family: helvetica;
- }
- </style>
- </head>
- <body>
- <p id="demo">Made by python</p>
- </body>
- </html>
- """
- current_time = datetime.datetime.now()
- while flag is True:
- user_input = input(">")
- if user_input == "time":
- print("Current date and time:", current_time)
- else:
- pass
- if user_input == "mkdir":
- os.mkdir("directory from terminal")
- print('A directory named "directory from terminal" has been created on your computer.')
- else:
- pass
- if user_input == "whoami":
- print(os.getlogin())
- else:
- pass
- if user_input == "os":
- system1 = platform.system()
- print(platform.system())
- else:
- pass
- if system1 == "Windows":
- tkinter.message
- if user_input == "get area of square":
- area_width = int(input("Width: "))
- area_height = int(input("Height: "))
- sum_of_area = area_width * area_height
- print(sum_of_area)
- else:
- pass
- if user_input == "get power of":
- num1 = float(input("Base: "))
- num2 = float(input("Exponent: "))
- sum1 = num1**num2
- print(sum1)
- else:
- pass
- if user_input == "random":
- rand_num = random.randint(1, 1000 + 1)
- print(rand_num)
- else:
- pass
- if user_input == "exec":
- exec_string = input("Put python code (one line): ")
- exec(exec_string)
- else:
- pass
- if user_input == "say":
- say_command = input("say: ")
- print(say_command)
- else:
- pass
- if user_input == "html":
- html_file = open("python_html", 'w')
- html_file.write(source_code)
- html_file.close()
- else:
- pass
- if user_input == "get html source code":
- html_file = open("python_html", 'r')
- print(html_file.read())
- html_file.close()
- else:
- pass
- if user_input == "current directory":
- print(os.getcwd())
- else:
- pass
- if user_input == "sqrt":
- sqrt_input = float(input("Get square root of: "))
- print(math.sqrt(sqrt_input))
- else:
- pass
- if user_input == "help":
- print("List of all commands.")
- print("**********")
- print("time")
- print("mkdir")
- print("whoami")
- print("os")
- print("get area of square")
- print("get power of")
- print("random")
- print("exec")
- print("say")
- print("html")
- print("get html source code")
- print("current directory")
- print("sqrt")
- print("**********")
- else:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement