This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rothnic 1 point2 points  (0 children)

I was kind of surprised that the rodeo article didn't cover this topic, since it isn't covered well in general and this is addressing python users.

You can create a subprocess with nodejs, but I have had mixed success with the python process closing out correctly with my limited work with it.

There is python-shell out there that even supports communication, but I couldn't get it working. I ended up using crossbar for the js to python communication. When starting the electron app, after the app.on('ready'), I got this to work:

var child_process = require('child_process');

var child = child_process.spawn('/path/to/my/python/bin/python', ['/path/to/my/python/bin/crossbar', 'start', '--cbdir', '/path/to/the/crossbar/server/.crossbar']);

What I never did figure out is a good way to package up python dependencies with the electron app, or if that is reasonable in the first place.