Continuously run a Python script from Node.js -
i have python code trying link node.js.
what want start python script , have continuously running , able call functions in script node.
i have tried using python-shell module , works great running script haven't figured out how call specific functions python file.
here .js code working with:
var mypythonscriptpath = 'junk.py'; // use python shell var pythonshell = require('python-shell'); var pyshell = new pythonshell(mypythonscriptpath); pythonshell.run('junk.py', function (err) { if (err) throw err; console.log('finished'); }); pyshell.end(function (err) { if (err){ throw err; }; console.log('finished'); });
Comments
Post a Comment