I was trying to call a python code from my node file.
Here is my node.js Code:
var util = require("util");
var spawn = require("child_process").spawn;
var process = spawn('python',["workpad.py"]);
util.log('readingin')
process.stdout.on('data',function(data){
util.log(data);
});
and my python part:
import sys
data = "test"
print(data)
sys.stdout.flush()
In the cmd window, only util.log('readingin') is shown. What's the problem of my code?