nishant kumar
nishant kumar

Reputation: 517

executing python script from a node.js

I am trying to run a python a script which will update my elasticsearch data base, from a server which is implemented in node.js. My python script requires a csv files to read. though the csv file is present it is giving me this error(shown in imageerror)

Upvotes: 1

Views: 99

Answers (1)

JCollerton
JCollerton

Reputation: 3327

I think you will need to specify the filepaths relative to where your Node script is running from, rather than the Python one.

So if you have file structure:

- app.js
- /PythonFolder
   - script.py
   - data.csv

You will need to call the Python using whatever the equivalent to:

python script.py PythonFolder/data.csv 

is from Node.

Upvotes: 3

Related Questions