I am currently attempting to build a program that automates a simple addition calculation using pyautogui by copying and pasting a number. So far, my code looks like this (without the hypothetical coordinates of what the program is supposed to copy):
pyautogui.keyDown("ctrl")
pyautogui.press("c")
pyautogui.keyUp("ctrl")
n = input("Insert a number: "
pyautogui.keyDown("ctrl")
pyautogui.press("v")
pyautogui.keyUp("ctrl")
print(n + n)
The problem with this code is that the input statement halts the program, which means that the program can't insert the copied element in the input statement. Is there a workaround or a different solution to storing the copied element inside a variable using pyautogui?