哪个库从nodejs调用python脚本?

问题描述:

我正在使用angular fullstack,一个yoeman生成器来创建一个web应用程序。我想从nodejs调用python脚本,这些脚本将返回一些输出,这些输出将显示在html页面中。我应该使用哪个库?提前致谢 。哪个库从nodejs调用python脚本?

Child Process将是你想要的。在我发给你的链接中有一个完整的文档,这非常简单。

什么,你可能需要知道的最少是这样的:

child_process = require('child_process'); 
var script = child_process.exec('python script.js',function(err,stdout, stderr) { 
    if (err) throw err; 
    console.log("Output: " + stdout); 
});;