I have this js code:
const python = spawn('python', [path.join(settings.PROJECT_DIR, '/tests_explorer/scripts/product/product.py').replace(/\\/g, "/"), 'node.js', 'python']);
python.stdout.on('data', function (data) {
console.log('Pipe data from python script ...');
dataToSend = data.toString();
console.log(dataToSend)
});
It should execute my python Script product.py:
import sys
import general.general //my own utils
print('#Hello from python#')
print('First param:'+sys.argv[1]+'#')
print('Second param:'+sys.argv[2]+'#')
name = general.id_generator(9)
print(name)
But the node js seems skipped to run my python, if I don't import general.general which is my own utils to generate random name, the python well executed and I can see the print data Is anyone know how to solve this? Thankyou