How to communicate between Python3 and JavaScript via sockets

if you need to connect to a NodeJS javascript environment then you should take a look at this native package https://nodejs.org/api/net.html#class-netsocket

if you need to connect to a browser javascript environment then you should take a look at WebSockets

  • Python: https://websockets.readthedocs.io/en/stable/#:~:text=websockets%20is%20a%20library%20for,an%20elegant%20coroutine%2Dbased%20API.
  • Javascript https://developer.mozilla.org/es/docs/Web/API/WebSockets_API