javascript - Pass flags to Python Script from Node/Express app python-shell -


i trying figure out how pass flags python script node/express application. when in command line execute script running:

python ndbc.py --buoy 46232 

i using python-shell module, think should allow me this, not entirely sure how works.

python-shell documentation:

https://github.com/extrabacon/python-shell#running-a-python-script-with-arguments-and-options

adapted readme, should work:

var pythonshell = require('python-shell');  var options = {   args: ['--buoy', '46232'] };  pythonshell.run('ndbc.py', options, function (err, results) {   if (err) throw err;   console.log('results: %j', results); }); 

Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -