Node module that allows you to run Python code from JS.
This module only supports Windows (Tested on Windows 10)
Install python-js by running:
$ npm install --save https://github.com/MeowSky49887/PythonJS.gitSpecified Python Version in package.json:
{
"python": {
"version": "3.11"
},
"dependencies": {
"python-js": "github:MeowSky49887/PythonJS"
}
}Example
const PythonJS = require("python-js");
const py = new PythonJS({port: 5555});
const main = await py.init("./main.py");
const output = await main.pi();
console.log(output);
await py.stop();import math
def pi():
return math.pi