I have hardware running on nodejs, and I have written machine learning code in python3. I want to call python3 program from nodejs (javascript) and pass data as arguments to python program.
I have found some of the methods like using spawn, python-shell, etc. which calls python by creating a child process.
But I want to call python from the parent process itself, without creating a child process. Means, only process, that is parent nodejs process should be running.
test.py
def someFunction():
#some code here
#print the arguments received.
someFunction ()
test.js
call test.py from this test.js and need to pass arguments to python program as well.
call test.py with arguments as ('xyz', 'abc')
I expect the output: xyz abc
Didn't find any way to call without creating and starting child process.