cancel
Showing results for 
Search instead for 
Did you mean: 

Call Python script from Node runtime

piyushgupta
Explorer
0 Kudos

I need to call a python script from Node.js runtime.

I have tried using "child-process" library in node to call the Python script which works locally but doesn't install the python libraries (like pandas, etc) in the node runtime in BTP.

I am also trying to host python as a micro service and call it from the node.js using AJAX calls but it's not working as well.

Any leads on a solution will be really appreciated.

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos

Do you have any more details about your requirements: what kind of data has to be passed between nodes and python apps and back? What are other dependencies your python app requires?

Accepted Solutions (0)

Answers (1)

Answers (1)

martinstenzig
Contributor
0 Kudos

This example shows you how you can use libs like flasks in Python and package it up in an MTA. https://blogs.sap.com/2021/04/20/deployment-of-python-web-server-to-cloud-foundry-using-mta/

You could use the same pattern to build out a microservice that encapsulates your Python functionality and then use the MTA to create the bind between Nodejs and Python module.