So I'm working on a little board game project in React, using TypeScript. I also want to create an engine that gives an evaluation for the current board state (i.e. Player 1 wins in 2 moves), but I would prefer to write it in Python.
What are some ways in which I can send the board state from my TS code to my Python code and receive a response?
I have tried using AJAX to send a request to my Python file. However, I am unsure of how to input to it through standard input, and how I would get the values that it prints to standard output (or if there is a better way to receive these values) in my current situation. Since the Python file is stored on my local file system, would I need to use a backend framework to host it on a server/api?
Thank you for your help if this is a dumb question.