2015-11-03 32 views
-1

我正在使用angular fullstack,一個yoeman生成器來創建一個web應用程序。我想從nodejs調用python腳本,這些腳本將返回一些輸出,這些輸出將顯示在html頁面中。我應該使用哪個庫?提前致謝 。哪個庫從nodejs調用python腳本?

回答

0

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); 
});;