(sorry for my bad english), Im making a Magic Mirror and Im developing a Module for that. I had done a script in python and I need to print consantly the shell of the script because is a "While True". For that I need to do a child process but my problem is: while my script is running it doest print anything in the log console or the mirror.
The file of node_helper.js --->
var NodeHelper = require("node_helper")
var { spawn } = require("child_process")
var self = this
async function aexec() {
const task = spawn('python3', ['/Fotos/reconeixementfacial.py'])
task.stdout.on('data', (data) => {
console.log(`${data}`)
})
task.stdout.on('exit', (data) => {
console.log("exit")
})
task.stdout.on('error', (data) => {
console.log(`${error}`)
})
task.unref()
}
module.exports = NodeHelper.create({
start: function() {
aexec()
},
socketNotificationReceived: function(notification, payload) {
console.log(notification)
}
})
Thank you so much for the time !! Note: If my python script doesnt have a "while true" (only a sequence), it works, only doesnt work if my script is undifined