What you need is a socket server on the python end and a client/request server on the javascript end. For the python server side, refer to SocketServer , (example taken from there as well), one thing you have to make sure is to have the socket go past NAT (possibly port forwarding).
Read moreHow do I connect JavaScript to Python?
Create a POST API Endpoint
Read moreCan Python code be converted to JavaScript?
Did you know that it is possible to convert Python code to JavaScript? Well, yes! It is definitely possible . Although both are excellent programming languages with advantages and disadvantages, many beginning developers decide to start learning Python.
Read moreCan I write Python in react?
Yes . React is mostly agnostic of what’s going on at the server-level. ie it does not care what backend you use.
Read moreHow do you call a Python script from HTML?
In this article, we will learn how to run a Python script in HTML.
Read moreHow do you call a Python script from react JS?
How to Run a Python script from Node.
Read moreCan you call Python function from JavaScript?
You cannot directly invoke a Python function from JS : JS is executed in your browser; Python is executed in your server. In order to call a Python function (in your server) from JS (in your browser), you need an interaction from the browser to the server.
Read more