Communicating with JavaScript and Python is easy. All you need to do is use Python’s requests
library to communicate. But this is just for the requests. You will also need a server to communicate. We can use Python’s Flask
library to set up a server and communicate. There is also a part of Python’s Flask called jsonify
that can allow you to turn our Python-generated format to JSON. We would also need to use Node.js’s child_processes()
library to handle our communications with our Python while doing the main task of our JavaScript. This can work, if your Flask server is booted up. I forgot to boot it up and my HTML did absolutely nothing when I interacted with it. So boot up your Flask server and create the Pycommunicate.js package (or whatever you want to call it)