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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -