Created
March 3, 2020 05:34
-
-
Save JaiParakh/61dc751e5f06d830d6b87552b83bf39f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//We will have to create a childprocess in order tocall python script. | |
var spawn = require("child_process").spawn; | |
//This process is called here. | |
var process = spawn('python',["./add.py",7,3] ); | |
//We listen for 'data' event. | |
process.stdout.on('data', function (data) { | |
console.log("Sum " + JSON.parse(data.toString()).sum); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment