Skip to content

Instantly share code, notes, and snippets.

@andreemidio
Created September 4, 2019 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreemidio/4b982823198f7cb50a4a572ddaf3fd88 to your computer and use it in GitHub Desktop.
Save andreemidio/4b982823198f7cb50a4a572ddaf3fd88 to your computer and use it in GitHub Desktop.
var spawn = require('child_process').spawn,
py = spawn('python', ['score.py']),
data = [],
dataString = '';
py.stdout.on('data', function(data){
dataString += data.toString();
});
py.stdout.on('end', function(){
console.log(dataString);
});
py.stdin.write(JSON.stringify(data));
py.stdin.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment