0

I would like to know which is the easiest way to send an array of values from JS to a Python Script and then, after some operations, send back from Python to JS the modified array and print it with console.log(array) to check the changes.

I am working with node js and my server in running on http://localhost:1234

Thank you in advance

Teo
  • 41
  • 1
  • 1
  • 6
  • 1
    Would this work? https://www.ivarprudnikov.com/nodejs-server-running-python-scripts/ – Cat Feb 24 '20 at 11:26
  • 1
    There are many ways: Nodejs can execute a Python script via [subprocess](https://nodejs.org/api/child_process.html), you could use a database and/or some pub/sub mechanisms (like Redis pub/sub). Run the Python script within a webserver and let node.js make AJAX call. – Maurice Meyer Feb 24 '20 at 11:29
  • 3
    Does this answer your question? [Combining node.js and Python](https://stackoverflow.com/questions/10775351/combining-node-js-and-python) – Daniel Marchand Feb 24 '20 at 12:44

0 Answers0