2

I've written python scripts for some numerical analysis topics and so I want to plot them in a nice way using any Java Script library.

So, I got to know about python-node and they show some brief doc info at that site:

var python = require('node-python');
var os = python.import('os');

// nodejs stuff
var path = require('path');

assert(os.path.basename(os.getcwd()) == path.basename(process.cwd()))

However, how could I start to actually do python, import python libraries, run python scripts, etc?

diegoaguilar
  • 7,935
  • 13
  • 73
  • 122

1 Answers1

1

That example show how to use import and call functions.

Try following:

var python = require('node-python');
var script = python.import('your_script_module_name');

script.your_function(argument1, argument2)
falsetru
  • 336,967
  • 57
  • 673
  • 597