|

楼主 |
发表于 2018-7-31 14:18:22
|
显示全部楼层
- var exec = require('child_process').exec;
- var arg1 = 'hello'
- var arg2 = 'jzhou'
- exec('python py_test.py '+ arg1+' '+arg2+' ',function(error,stdout,stderr){
- if(stdout.length >1){
- console.log('you offer args:',stdout);
- } else {
- console.log('you don\'t offer args');
- }
- if(error) {
- console.info('stderr : '+stderr);
- }
- });
复制代码
这个是nodejs代码,但在wex5的平台上调用var exec = require('child_process').exec;就不行 |
|