From 22b30677376b980c3192e1d74c3712ad8980872e Mon Sep 17 00:00:00 2001 From: LarsGavris <38732755+LarsGavris@users.noreply.github.com> Date: Wed, 3 May 2023 20:55:08 +0200 Subject: [PATCH] Allow passing arbitrary arguments to the python interpreter see #42 --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c19811d..8fbba71 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,8 @@ const PYTHON_BRIDGE_SCRIPT = path.join(__dirname, 'node_python_bridge.py'); function pythonBridge(opts) { // default options let intepreter = opts && opts.python || 'python'; + let args = opts && opts.args || []; + args.push(PYTHON_BRIDGE_SCRIPT); let stdio = opts && opts.stdio || ['pipe', process.stdout, process.stderr]; let options = { cwd: opts && opts.cwd, @@ -19,7 +21,7 @@ function pythonBridge(opts) { }; // create process bridge - let ps = child_process.spawn(intepreter, [PYTHON_BRIDGE_SCRIPT], options); + let ps = child_process.spawn(intepreter, args, options); let queue = singleQueue(); function sendPythonCommand(type, enqueue, self) {