-1

I am having a function in a js file which uses an npm library and provides some response. Now since my app is running on python, I intend to use this js function from a python script.

eg:- I have a file pure.js

function add(a, b) {
    return a + b;
}

the python file --> main.py

import pure
print(pure.add(5, 7))

is there any way to use the add function from the pure.js file in main.py?

2
  • There shouldn't be any need to use a javascript module in python, what are you really trying to do Commented May 5, 2020 at 8:16
  • I need to use the following npm library - github.com/json-schema-faker/json-schema-faker. This library provides a valid sample JSON for the given JSON-schema. After obtaining the sample from the js file I need to utilize in my python app Commented May 5, 2020 at 8:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.