繁体   English   中英

Node.js通过带有传递参数的shell脚本执行python脚本

[英]Node.js execute python script through shell script with passed arguments

所以我有一些JavaScript代码将执行shell scipt:

    var exec = Meteor.npmRequire('child_process').exec;
    exec("/Users/ray/Desktop/scripts/hello.sh");

这个shell scipt将执行一个python文件。 我想知道如何从我的JavaScript代码中将此shell脚本传递给python脚本一些参数?

我相信,如果您要这样添加您的论点:

exec("/Users/ray/Desktop/scripts/hello.sh arg1 arg2 arg3");

它应该工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM