Use exit
event for the child process.
var child = require('child_process').exec('python celulas.py')
child.stdout.pipe(process.stdout)
child.on('exit', function() {
process.exit()
})
PS: It's not really a duplicate, since you don't want to use sync code unless you really really need it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…