#Execute the script, then highlight something. It will turn the
#highlighted text into an equation and put the result in your clip board.
#Noice
import random
import pyautogui as pya #Used to press ctrl-c
import pyperclip #Handy cross-platform clipboard text handler
import time
from Equation import Expression
time.sleep(5) #Gives a 5 second delay, so you can highlight stuff
def copy_clipboard():
pya.hotkey('ctrl', 'c')
time.sleep(.01) #ctrl-c is usually very fast but the program may execute faster
return pyperclip.paste()
text = str(copy_clipboard()) #This copies what you have highlighted and makes it to a string
def calculate(equation): #This calculates
fn = Expression(equation)
pyperclip.copy(fn()) #Copies the new sentence as a string to the clip board
calculate(text) #The executioner