Technical Articles
Running Python from Node.js in SAP Business Application Studio
Hi Fellow Developers,
In my recent project we come across a requirement where we need to connect Node.js with Python. So, I thought of writing a blog on it.
In below example we will create a simple service where we run Python script and show “Hello world from python”.
First we need to install python for node modules in our project. Run below command to install python in SAP BAS.
Create simple Python script to print “Hello world from python”
(readPython is the file I created for the catching the python script in the get request, the code in the file is shown in the second step after installing python in BAS.)
After that run your service by “npm run start”.
Conclusion :
In the above blog we learn how to call a python script into our Node js service through a get call. And we catch the response and show it in console.