I have some code written in python that uses PyAutoGui:
import pyautogui
def mult_choice(OPTION):
if OPTION == 1:
pyautogui.press('1')
elif OPTION == 2:
pyautogui.press('2')
elif OPTION == 3:
pyautogui.press('3')
elif OPTION == 4:
pyautogui.press('4')
sleep(2)
I also plan to write some code in Javascript that will get the variable OPTION. As far as I know, you can't control the keyboard in Javascript, so I wrote that part in Python. However, I wasn't sure if it is possible to run a python function in a Javascript program. If this is possible, someone explaining it to me would be appreciated.