Read the statement by Michael Teeuw here.
How to have Python and JS talk to each other?
-
Hi all,
I have a question for the JS / Python pros out there:
I have a python program doing some long lasting process and consistently printing out the progress of its work to the console. (I have it running in a tmux virtual shell)
I was wondering what would be the best way to “include” this program into a mirror module.A first step would be to pass on the python stdout print to a JS module.
What is the best way for that?
Is there any way for a python program to “talk” to my JS module?Thanks for any help or hints!
-
@lavolp3 in JavaScript, node_helper use the spawn function, and handle.stdout.on() method to get called when there is data from the python script
https://www.freecodecamp.org/news/node-js-child-processes-everything-you-need-to-know-e69498fe970a/
-
@sdetweil Great! Will have a look at it. Thank you Sam!
-
@lavolp3 you can have a look into https://github.com/paviro/MMM-Facial-Recognition/blob/master/node_helper.js which is doing the communication between the python script and module
-
@strawberry-3-141 and that uses a larger wrapper of python scripts called PythonShell
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login